Django

Code

Changeset 5629

Show
Ignore:
Timestamp:
07/07/07 12:15:54 (1 year ago)
Author:
mtredinnick
Message:

Changed HttpRequest.path to be a Unicode object. It has already been
URL-decoded by the time we see it anyway, so keeping it as a UTF-8 bytestring
was causing unnecessary problems.

Also added handling for non-ASCII URL fragments in feed creation (the portion
that was outside the control of the Feed class was messed up).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/syndication/feeds.py

    r5609 r5629  
    33from django.contrib.sites.models import Site 
    44from django.utils import feedgenerator 
    5 from django.utils.encoding import smart_unicode 
     5from django.utils.encoding import smart_unicode, iri_to_uri 
    66from django.conf import settings 
    77 
     
    1010        # 'url' must already be ASCII and URL-quoted, so no need for encoding 
    1111        # conversions here. 
    12         url = u'http://%s%s' % (domain, url
     12        url = iri_to_uri(u'http://%s%s' % (domain, url)
    1313    return url 
    1414 
  • django/trunk/django/core/handlers/modpython.py

    r5609 r5629  
    33from django.dispatch import dispatcher 
    44from django.utils import datastructures 
     5from django.utils.encoding import force_unicode 
    56from django import http 
    67from pprint import pformat 
     
    1415    def __init__(self, req): 
    1516        self._req = req 
    16         self.path = req.uri 
     17        self.path = force_unicode(req.uri) 
    1718 
    1819    def __repr__(self): 
  • django/trunk/django/core/handlers/wsgi.py

    r5609 r5629  
    33from django.dispatch import dispatcher 
    44from django.utils import datastructures 
     5from django.utils.encoding import force_unicode 
    56from django import http 
    67from pprint import pformat 
     
    7475    def __init__(self, environ): 
    7576        self.environ = environ 
    76         self.path = environ['PATH_INFO'] 
     77        self.path = force_unicode(environ['PATH_INFO']) 
    7778        self.META = environ 
    7879        self.method = environ['REQUEST_METHOD'].upper()