Changes between Initial Version and Version 1 of Ticket #11638


Ignore:
Timestamp:
Aug 5, 2009, 8:38:54 PM (15 years ago)
Author:
Karen Tracey
Comment:

Fixed formatting -- please use preview.

The description for #11522 seems to say the fix proposed there would also fix this case, so I'm going to close this as a dup of that one.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11638

    • Property Resolutionduplicate
    • Property Status newclosed
  • Ticket #11638 – Description

    initial v1  
    11I'm trying to download via GET a file with name in russian and getting
    2 
     2{{{
    33Environment:
    44
     
    3838Exception Type: UnicodeEncodeError at /file/4719e0bdedaa4f741f032991894d52ecb08c3476a598504fd1fee92d
    3939Exception 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}}}
    4141The code which cause this error:
     42{{{
     43#!python
    4244upfile = UpFile.objects.get(file_hash=file_hash)
    4345path = os.path.join(settings.UPLOAD_ROOT, request.user.username,
    4446upfile.file_name)
    4547return HttpResponseRedirect(path)
    46 
     48}}}
    4749If filename in English everything works ok.
    4850The file was uploaded this way:
    49 
     51{{{
     52#!python
    5053dir_path = os.path.join(settings.UPLOAD_ROOT, request.user.username)
    5154upfile = UpFile.objects.create(user=user, file_name=file.name,
     
    5861    destination.write(chunk)
    5962destination.close()
    60 
     63}}}
     64{{{
    6165DEFAULT_CHARSET = 'utf-8'
    6266DATABASE_ENGINE = 'sqlite3'
    63 
     67}}}
    6468The name of the file is correctly readable in my system(ls -lh):
    6569locale
     70{{{
    6671LANG=en_US.UTF-8
    6772LC_CTYPE="en_US.UTF-8"
     
    7883LC_IDENTIFICATION="en_US.UTF-8"
    7984LC_ALL=
     85}}}
Back to Top