File attachment to any doctype problem with arabic file names

Dear All,

I am facing problem in file attachments. when i am attaching any file or image file to employee doctype its uploaded and attached successfully. after this when i click on image file it give error.

Error message started here.


UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xd9 in position 15: ordinal not in range(128)
Traceback (most recent call last)

File "/home/hroms/frappe-bench/apps/frappe/frappe/", line 15, in __call__

return super(StaticDataMiddleware, self).__call__(environ, start_response)

File "/home/hroms/frappe-bench/env/lib/python2.7/site-packages/werkzeug/", line 761, in __call__

if path.startswith(search_path):

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd9 in position 15: ordinal not in range(128)

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the “Traceback” headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object

What is the name of your file? I just tried uploading a file with arabic filename, and it uploaded just fine.

Dear Uploading of file is perfect, but when click on it it give error

Dear gsbaig
please refer to this post Dropbox Backup question - UnicodeDecodeError arabic locale - #24 by a.elhaidary
the same error with me and the solution is there, hope it would help