Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#10241 closed (invalid)

read a (non-ascii) characte file name : 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)

Reported by: isoemail@… Owned by: nobody
Component: File uploads/storage Version: 1.0
Severity: Keywords: read a (non-ascii) character file name a unicode (non-ascii) character filename
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

when read "/admin/filebrowser/File/中文文件名" a (non-ascii) characte file name

Unicode error hint

UnicodeDecodeError at /admin/filebrowser/File/
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128))

Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  86.                 response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/decorators.py" in _checklogin
  33.             return view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/home/virtualhost/lfreeren/dllb.cn/public_html/new/org/filebrowser/views.py" in index
  64.         var_filesize_long = os.path.getsize(os.path.join(PATH_SERVER, path, file))
File "/usr/lib/python2.5/posixpath.py" in join
  63.             path +=  b

Exception Type: UnicodeDecodeError at /admin/filebrowser/File/
Exception Value: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)

Change History (5)

comment:1 by Ramiro Morales, 16 years ago

Resolution: invalid
Status: newclosed

The traceback is generated in an index view contained in a filebrowser/views.py file that isn't included with Django, it seems to be part of your application or a third party application so I don't think this is a Django problem.

PS: It seems to happen when trying to calculate some file size So the best thing to do would be to review the Python documentation for the functions involved in that failing code (os.path.getsize. os.path.join) in regard to handling of non-ASCII paths.

comment:2 by anonymous, 16 years ago

Resolution: invalid
Status: closedreopened

comment:3 by isoemail@…, 16 years ago

The same code django0.96 operating normally,
Django1.0 running in error

in reply to:  3 comment:4 by Luke Plant, 16 years ago

Resolution: invalid
Status: reopenedclosed

Replying to isoemail@163.com:

The same code django0.96 operating normally,
Django1.0 running in error

That's probably because of the unicode changes that happened between 0.96 and 1.0, listed on BackwardsIncompatibleChanges

If you can show that this is really a bug in Django itself then re-open.

comment:5 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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