Unable to upload images with arabic name


when i try to upload an image with arabic name i get an error

  Traceback (most recent call last):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 108, in uploadfile
    ret = frappe.utils.file_manager.upload()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 36, in upload
    filedata = save_uploaded(dt, dn, folder, is_private)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 60, in save_uploaded
    return save_file(fname, content, dt, dn, folder, is_private=is_private);
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 182, in save_file
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 192, in insert
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_before_save_methods
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 666, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 892, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 875, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 660, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 72, in validate
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 135, in validate_file
    if not os.path.exists(get_files_path(frappe.as_unicode(self.file_name.lstrip("/")))):
  File "/home/erpnext/frappe-bench/env/lib/python2.7/genericpath.py", line 18, in exists
UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-29: ordinal not in range(128)

can any one give me a hint on how to solve this

erpnext version is
version = ‘8.0.46’

I have a feeling that this might already be fixed in later versions. Version 8 is already at EOL and no longer supported. However, you can still open an issue on github and someone from the community can pick it up.

@tundebabzy thanks for the replay

1 Like