Code

Opened 2 years ago

Closed 2 years ago

#18561 closed Bug (fixed)

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

Reported by: matsevich.devel@… Owned by: claudep
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 claudep 2 years ago.
Make tell() handle unicode content

Download all attachments as: .zip

Change History (4)

comment:1 Changed 2 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to claudep
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

Changed 2 years ago by claudep

Make tell() handle unicode content

comment:2 Changed 2 years ago by claudep

  • Has patch set

comment:3 Changed 2 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In [23f94f0741100233862922a8e77a3ac9dc1833e9]:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.