Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8219 closed (fixed)

RSS Syndication UnicodeDecodeError

Reported by: alperkanat Owned by: nobody
Component: contrib.syndication Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

i'm generating a rss feed from a model... it works fine.. but if i use LocaleTextCalendar somewhere in the template using some locale (tr_TR.UTF-8) it says:

UnicodeDecodeError at /feeds/latest/
'ascii' codec can't decode byte 0xc4 in position 9: ordinal not in range(128)

if i restart the development server and go to a page that doesn't include the LocaleTextCalendar with the locale, then the feed works fine.. But once I go to the page that includes the LocaleTextCalendar with locale, even the page that doesn't have it, won't work.. I searched through all the code if I assign some locale somewhere but nope.. I forgot to use u around the code but it still didn't solve this problem even I added u..

Attachments (1)

rss.patch (2.4 KB ) - added by alperkanat 16 years ago.
decoding ascii instead of utf-8

Download all attachments as: .zip

Change History (4)

by alperkanat, 16 years ago

Attachment: rss.patch added

decoding ascii instead of utf-8

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: post-1.01.0
Triage Stage: UnreviewedReady for checkin

I don't really understand the problem description -- I understand the error, but not how you caused it. Still, the patch looks like a reasonable idea as a general rule.

The only problem is that there's probably no guarantee that strftime() will return any particular encoding at all, which is a bit of a problem. That's a problem with the underlying C library call, if I'm right. Nothing we can do about it without replacing strftime with our own version (which isn't impossible if it comes to that).

Promoting to checkin stats and setting the milestone, since the patch can't hurt and looks more consistent in any case.

comment:2 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [8397]) Fixed #8219 -- More robust date to string conversion in syndication feeds.
(Sometimes) Affects people running in locales that use non-ASCII date strings.
Patch from alperkanat.

comment:3 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top