Django

Code

Ticket #1086 (closed: invalid)

Opened 4 years ago

Last modified 3 years ago

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

Reported by: Esaj Assigned to: adrian
Milestone: Component: Django Web site
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

feeds.py.diff (3.4 kB) - added by Esaj on 12/19/05 08:19:18.
feeds.py.2.diff (3.7 kB) - added by Esaj on 12/19/05 08:22:26.
Oops, forgot to import the exception…

Change History

12/19/05 08:19:18 changed by Esaj

  • attachment feeds.py.diff added.

12/19/05 08:22:26 changed by Esaj

  • attachment feeds.py.2.diff added.

Oops, forgot to import the exception...

12/19/05 08:26:11 changed by adrian

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

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

12/19/05 10:21:43 changed by Esaj

  • status changed from closed to reopened.
  • resolution deleted.
  • component changed from RSS framework to Django project website.

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?

12/20/05 21:49:10 changed by adrian

  • status changed from reopened to closed.
  • resolution set to invalid.

Add/Change #1086 ([patch] UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 28: unexpected code byte)




Change Properties
Action