Opened 7 years ago

Closed 7 years ago

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

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:3 follow-up: Changed 7 years ago by isoemail@…

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

comment:4 in reply to: ↑ 3 Changed 7 years ago by lukeplant

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

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

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

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