Changes between Initial Version and Version 1 of Ticket #11638
- Timestamp:
- Aug 5, 2009, 8:38:54 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11638
- Property Resolution → duplicate
- Property Status new → closed
-
Ticket #11638 – Description
initial v1 1 1 I'm trying to download via GET a file with name in russian and getting 2 2 {{{ 3 3 Environment: 4 4 … … 38 38 Exception Type: UnicodeEncodeError at /file/4719e0bdedaa4f741f032991894d52ecb08c3476a598504fd1fee92d 39 39 Exception Value: ('ascii', u'/site_media/upload/alecs/\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0447\u0442\u044b.doc', 25, 34, 'ordinal not in range(128)') 40 40 }}} 41 41 The code which cause this error: 42 {{{ 43 #!python 42 44 upfile = UpFile.objects.get(file_hash=file_hash) 43 45 path = os.path.join(settings.UPLOAD_ROOT, request.user.username, 44 46 upfile.file_name) 45 47 return HttpResponseRedirect(path) 46 48 }}} 47 49 If filename in English everything works ok. 48 50 The file was uploaded this way: 49 51 {{{ 52 #!python 50 53 dir_path = os.path.join(settings.UPLOAD_ROOT, request.user.username) 51 54 upfile = UpFile.objects.create(user=user, file_name=file.name, … … 58 61 destination.write(chunk) 59 62 destination.close() 60 63 }}} 64 {{{ 61 65 DEFAULT_CHARSET = 'utf-8' 62 66 DATABASE_ENGINE = 'sqlite3' 63 67 }}} 64 68 The name of the file is correctly readable in my system(ls -lh): 65 69 locale 70 {{{ 66 71 LANG=en_US.UTF-8 67 72 LC_CTYPE="en_US.UTF-8" … … 78 83 LC_IDENTIFICATION="en_US.UTF-8" 79 84 LC_ALL= 85 }}}