Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#10943 closed (invalid)

ordinal not in range(128)

Reported by: gulliver Owned by: nobody
Component: Uncategorized Version: 1.1-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Before Apri 24, it is worked fine that adding file whith chinese characters, but after Apri 27, error comes.

I don't understand why.

I hadn't upgraded anything.

Help.

UnicodeEncodeError at /admin/articles/article/18248/

('ascii', u'/home/httpd/html/media/doc/2009/04/28/\u90b3\u5dde\u516c\u53f8\u8df5\u884c\u79d1\u5b66\u53d1\u5c55\u89c2\u670d\u52a1\u53d1\u5c55\u5f53\u5148\u950b.jpg', 38, 56, 'ordinal not in range(128)')

Request Method: 	POST
Request URL: 	http://172.30.113.203/admin/articles/article/18248/
Exception Type: 	UnicodeEncodeError
Exception Value: 	

('ascii', u'/home/httpd/html/media/doc/2009/04/28/\u90b3\u5dde\u516c\u53f8\u8df5\u884c\u79d1\u5b66\u53d1\u5c55\u89c2\u670d\u52a1\u53d1\u5c55\u5f53\u5148\u950b.jpg', 38, 56, 'ordinal not in range(128)')

Exception Location: 	/usr/lib/python2.6/genericpath.py in exists, line 18
Python Executable: 	/usr/bin/python
Python Version: 	2.6.0
Python Path: 	['/home/lio/mydjango', '/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/PIL']
Server time: 	星期二, 28 四月 2009 08:54:20 +0800

Unicode error hint

The string that could not be encoded/decoded was: 4/28/邳州公司践行科学发展观服务发展当先锋.jpg

Environment:

Request Method: POST
Request URL: http://172.30.113.203/admin/articles/article/18248/
Django Version: 1.1 beta 1 SVN-10638
Python Version: 2.6.0
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'ncdqh.articles']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py" in wrapper
  226.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py" in inner
  184.             return view(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/db/transaction.py" in _commit_on_success
  240.                 res = func(*args, **kw)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py" in change_view
  832.                     self.save_formset(request, form, formset, change=True)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py" in save_formset
  563.         formset.save()
File "/usr/lib/python2.6/site-packages/django/forms/models.py" in save
  440.         return self.save_existing_objects(commit) + self.save_new_objects(commit)
File "/usr/lib/python2.6/site-packages/django/forms/models.py" in save_existing_objects
  467.                 saved_instances.append(self.save_existing(form, obj, commit=commit))
File "/usr/lib/python2.6/site-packages/django/forms/models.py" in save_existing
  428.         return form.save(commit=commit)
File "/usr/lib/python2.6/site-packages/django/forms/models.py" in save
  338.                              fail_message, commit, exclude=self._meta.exclude)
File "/usr/lib/python2.6/site-packages/django/forms/models.py" in save_instance
  78.         instance.save()
File "/usr/lib/python2.6/site-packages/django/db/models/base.py" in save
  407.         self.save_base(force_insert=force_insert, force_update=force_update)
File "/usr/lib/python2.6/site-packages/django/db/models/base.py" in save_base
  461.                         values = [(f, None, (raw and getattr(self, f.attname) or f.pre_save(self, False))) for f in non_pks]
File "/usr/lib/python2.6/site-packages/django/db/models/fields/files.py" in pre_save
  191.             file.save(file.name, file, save=False)
File "/usr/lib/python2.6/site-packages/django/db/models/fields/files.py" in save
  83.         self._name = self.storage.save(name, content)
File "/usr/lib/python2.6/site-packages/django/core/files/storage.py" in save
  46.         name = self.get_available_name(name)
File "/usr/lib/python2.6/site-packages/django/core/files/storage.py" in get_available_name
  68.         while self.exists(name):
File "/usr/lib/python2.6/site-packages/django/core/files/storage.py" in exists
  198.         return os.path.exists(self.path(name))
File "/usr/lib/python2.6/genericpath.py" in exists
  18.         st = os.stat(path)

Exception Type: UnicodeEncodeError at /admin/articles/article/18248/
Exception Value: ('ascii', u'/home/httpd/html/media/doc/2009/04/28/\u90b3\u5dde\u516c\u53f8\u8df5\u884c\u79d1\u5b66\u53d1\u5c55\u89c2\u670d\u52a1\u53d1\u5c55\u5f53\u5148\u950b.jpg', 38, 56, 'ordinal not in range(128)')

Change History (2)

comment:1 by Ramiro Morales, 15 years ago

Resolution: invalid
Status: newclosed

Please don't blindly open tickets in the bug tracker in search of support when finding a problem like this, the #django IRC channel and the django-users mailing list (especially searching its huge archive) are your first choices in these cases. Try to only open a ticket here when, after looking through the archives and getting other users opinions, you are pretty sure it's not a setup problem or a bug in your code (for example if it's a new use case youǘe never tested your app against).

comment:2 by Jacob, 12 years ago

milestone: 1.1

Milestone 1.1 deleted

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