Opened 12 years ago

Closed 12 years ago

#18561 closed Bug (fixed)

HttpResponse.tell() fails if response contains non ascii characters

Reported by: matsevich.devel@… Owned by: Claude Paroz
Component: HTTP handling Version: 1.4
Severity: Normal Keywords: tell, HttpResponse, response
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If HttpResponse instance contains non ascii characters (e.g. cyrillic), tell() method fails.
Error otput:

UnicodeEncodeError at /

'ascii' codec can't encode characters in position 2010-2015: ordinal not in range(128)

Request Method: 	GET
Request URL: 	http://localhost:8000/
Django Version: 	1.4
Exception Type: 	UnicodeEncodeError
Exception Value: 	

'ascii' codec can't encode characters in position 2010-2015: ordinal not in range(128)

Exception Location: 	/usr/lib/python2.7/site-packages/django/http/__init__.py in tell, line 732
Python Executable: 	/usr/bin/python
Python Version: 	2.7.3
Python Path: 	

['/usr/bin',
 '/usr/lib/python2.7/site-packages/django_annoying-0.7.4-py2.7.egg',
 '/usr/lib/python2.7/site-packages/selenium-2.24.0-py2.7.egg',
 '/usr/lib/python2.7/site-packages/South-0.7.5-py2.7.egg',
 '/home/ghost/git/django-hello-world/django',
 '/usr/lib64/python27.zip',
 '/usr/lib64/python2.7',
 '/usr/lib64/python2.7/plat-linux2',
 '/usr/lib64/python2.7/lib-tk',
 '/usr/lib64/python2.7/lib-old',
 '/usr/lib64/python2.7/lib-dynload',
 '/usr/lib64/python2.7/site-packages',
 '/usr/lib64/python2.7/site-packages/PIL',
 '/usr/lib64/python2.7/site-packages/pbs',
 '/usr/lib64/python2.7/site-packages/gtk-2.0',
 '/usr/lib/python2.7/site-packages',
 '/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']

Attachments (1)

18561.diff (1.4 KB ) - added by Claude Paroz 12 years ago.
Make tell() handle unicode content

Download all attachments as: .zip

Change History (4)

comment:1 by Claude Paroz, 12 years ago

Owner: changed from nobody to Claude Paroz
Status: newassigned
Triage Stage: UnreviewedAccepted

by Claude Paroz, 12 years ago

Attachment: 18561.diff added

Make tell() handle unicode content

comment:2 by Claude Paroz, 12 years ago

Has patch: set

comment:3 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In [23f94f0741100233862922a8e77a3ac9dc1833e9]:

Fixed #18561 -- Made HttpResponse.tell() support non-ascii chars

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