Opened 10 years ago

Closed 10 years ago

Last modified 9 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
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: UI/UX:

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 10 years ago.
feeds.py.2.diff (3.7 KB) - added by Esaj 10 years ago.
Oops, forgot to import the exception…

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Esaj

Changed 10 years ago by Esaj

Oops, forgot to import the exception...

comment:1 Changed 10 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:2 Changed 10 years ago by Esaj

  • Component changed from RSS framework to Django project website
  • Resolution invalid deleted
  • Status changed from closed to reopened

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 Changed 10 years ago by adrian

  • Resolution set to invalid
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.
Back to Top