#10905: UnicodeEncodeError from FileUploadTests.test_unicode_file_name
--------------------------------------------------------------+-------------
Reporter: Richard Davies <[email protected]> | Owner:
nobody
Status: new | Milestone:
1.1
Component: File uploads/storage | Version:
1.0
Keywords: | Stage:
Unreviewed
Has_patch: 0 |
--------------------------------------------------------------+-------------
Running the test suite on a clean check out of r10628, I get:
{{{
======================================================================
ERROR: test_unicode_file_name
(regressiontests.file_uploads.tests.FileUploadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/elastic-
www/test/trunk/tests/regressiontests/file_uploads/tests.py", line 67, in
test_unicode_file_name
response = self.client.post('/file_uploads/unicode_name/', post_data)
File "/home/elastic-www/test/trunk/django/test/client.py", line 313, in
post
response = self.request(**r)
File "/home/elastic-www/test/trunk/django/core/handlers/base.py", line
92, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/elastic-
www/test/trunk/tests/regressiontests/file_uploads/views.py", line 64, in
file_upload_unicode_name
obj = FileModel.objects.create(testfile=uni_named_file)
File "/home/elastic-www/test/trunk/django/db/models/manager.py", line
126, in create
return self.get_query_set().create(**kwargs)
File "/home/elastic-www/test/trunk/django/db/models/query.py", line 284,
in create
obj.save(force_insert=True)
File "/home/elastic-www/test/trunk/django/db/models/base.py", line 407,
in save
self.save_base(force_insert=force_insert, force_update=force_update)
File "/home/elastic-www/test/trunk/django/db/models/base.py", line 471,
in save_base
values = [(f, f.get_db_prep_save(raw and getattr(self, f.attname) or
f.pre_save(self, True))) for f in meta.local_fields if not isinstance(f,
AutoField)]
File "/home/elastic-www/test/trunk/django/db/models/fields/files.py",
line 191, in pre_save
file.save(file.name, file, save=False)
File "/home/elastic-www/test/trunk/django/db/models/fields/files.py",
line 83, in save
self._name = self.storage.save(name, content)
File "/home/elastic-www/test/trunk/django/core/files/storage.py", line
46, in save
name = self.get_available_name(name)
File "/home/elastic-www/test/trunk/django/core/files/storage.py", line
68, in get_available_name
while self.exists(name):
File "/home/elastic-www/test/trunk/django/core/files/storage.py", line
198, in exists
return os.path.exists(self.path(name))
File "/lib/python2.5/posixpath.py", line 171, in exists
st = os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position
43-44: ordinal not in range(128)
}}}
My command line to run the tests was:
{{{
$ cat settings.py
DATABASE_ENGINE='sqlite3'
$ ./runtests.py --settings=settings file_uploads
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/10905>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---