Changes between Initial Version and Version 3 of Ticket #4430


Ignore:
Timestamp:
May 30, 2007, 9:45:52 PM (17 years ago)
Author:
Malcolm Tredinnick
Comment:

(fixed description formatting)

The patch goes a bit too far. We should never be applying smart_unicode() to anything is a URL. If they aren't already in ASCII, it's a bug on the client code's side (they should be using things like iri_to_uri() at the appropriate moments).

I'm having a bit of trouble understanding the original report, because smart_unicode() does work on the string you posted and you don't include what's in the traceback leading up to the error.

If the patch fixes it for you, can you just drop in a comment saying so? I'll apply a version of this patch anyway, since it mostly fixes some places that have been overlooked (thanks for testing that, both of you), but I would like some confirmation that it is fixing the original report as well.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4430

    • Property Has patch set
    • Property Triage Stage UnreviewedAccepted
  • Ticket #4430 – Description

    initial v3  
    11I have object with content attribute, where I have non-ascii data. For both cases (either specifying {{ obj.content }} in description template or by adding method
    22{{{
     3#!python
    34    def __unicode__(self):
    45        return smart_unicode(self.content)
    56}}}
    67), I got UnicodeDecodeError when trying to display feed:
    7 
     8{{{
    89UnicodeDecodeError at /feeds/wiki/
    910'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
     
    1314Exception Value:        'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
    1415Exception Location:     /usr/lib/python2.5/codecs.py in write, line 303
    15 
     16}}}
    1617
    1718Local variables show object codecs is trying to decode:
Back to Top