Django

Code

Ticket #8219 (closed: fixed)

Opened 4 months ago

Last modified 4 months ago

RSS Syndication UnicodeDecodeError

Reported by: alperkanat Assigned to: nobody
Milestone: 1.0 Component: RSS framework
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

rss.patch (2.4 kB) - added by alperkanat on 08/10/08 20:57:14.
decoding ascii instead of utf-8

Change History

08/10/08 20:57:14 changed by alperkanat

  • attachment rss.patch added.

decoding ascii instead of utf-8

08/10/08 21:52:01 changed by mtredinnick

  • needs_better_patch changed.
  • needs_docs changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • milestone changed from post-1.0 to 1.0.

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.

08/15/08 17:13:50 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #8219 (RSS Syndication UnicodeDecodeError)




Change Properties
Action