Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1086 closed defect (invalid)

[patch] UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 28: unexpected code byte

Reported by: Esaj Owned by: Adrian Holovaty
Component: *.djangoproject.com Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 28: unexpected code byte

I got this error today. I've attached a patch to make it ignore utf-8 decoding errors.

Traceback (most recent call last):

  File "/home/j/jason/django_src/django/core/handlers/base.py", line 74, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/home/j/jason/django_src/django/contrib/syndication/views.py", line 20, in feed
    feedgen = f(slug, request.path).get_feed(param)

  File "/home/j/jason/django_src/django/contrib/syndication/feeds.py", line 95, in get_feed
    feed.add_item(

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 28: unexpected code byte

Attachments (2)

feeds.py.diff (3.4 KB ) - added by Esaj 18 years ago.
feeds.py.2.diff (3.7 KB ) - added by Esaj 18 years ago.
Oops, forgot to import the exception…

Download all attachments as: .zip

Change History (5)

by Esaj, 18 years ago

Attachment: feeds.py.diff added

by Esaj, 18 years ago

Attachment: feeds.py.2.diff added

Oops, forgot to import the exception...

comment:1 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

Ignoring Unicode errors is not a good solution. The solution is to fix the encoding of your data.

comment:2 by Esaj, 18 years ago

Component: RSS frameworkDjango project website
Resolution: invalid
Status: closedreopened

I guess you're right. I'm actually using the aggregator app from django_website, so maybe that needs patching so it encodes content data as utf-8?

comment:3 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: reopenedclosed
Note: See TracTickets for help on using tickets.
Back to Top