Umlaut not working ö ä ü in Filenames

When uploading pictures for items: ERPnext does not upload the picture if there is a “ä”, “ü” or “ö” in the picture file name.

Are you running the latest version? We’ve removed this limitation.

We have similar problem in Serbian with ć č š ž đ

Are you able to replicate it on https://demo.frappecloud.com ?

Yes.

I’ve tried the following on our installation and on demo.frappecloud.com:

Upload the png File called: Lögä.png (formerly know as Logo.png)

In both cases the following error occured:
Traceback (innermost last):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 175, in save
self.insert()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 145, in insert
self._validate()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 262, in _validate
self._extract_images_from_text_editor()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 401, in _extract_images_from_text_editor
extract_images_from_html(self, df.fieldname)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 102, in extract_images_from_html
content = re.sub(’ File “/home/erpnext/frappe-bench/env/lib/python2.7/re.py”, line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 95, in _save_file
file_url = save_file(filename, content, doc.doctype, doc.name, decode=True).get(“file_url”)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 118, in save_file
fname = get_file_name(fname, content_hash[-6:])
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 254, in get_file_name
if len(n_records) > 0 or os.path.exists(get_files_path(fname.encode(‘utf-8’))):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/init.py”, line 279, in get_files_path
return get_site_path(“public”, “files”, *path)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/init.py”, line 276, in get_site_path
return get_path(base=get_site_base_path(), *path)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/init.py”, line 270, in get_path
return os.path.join(base, *path)
File “/home/erpnext/frappe-bench/env/lib/python2.7/posixpath.py”, line 80, in join
path += ‘/’ + b
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 3: ordinal not in range(128)

Traceback (innermost last):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/app.py”, line 49, in application
response = frappe.handler.handle()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py”, line 66, in handle
execute_cmd(cmd)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py”, line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 531, in call
return fn(*args, **newargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 175, in save
self.insert()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 145, in insert
self._validate()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 262, in _validate
self._extract_images_from_text_editor()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 401, in _extract_images_from_text_editor
extract_images_from_html(self, df.fieldname)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 102, in extract_images_from_html
content = re.sub(’ File “/home/erpnext/frappe-bench/env/lib/python2.7/re.py”, line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 95, in _save_file
file_url = save_file(filename, content, doc.doctype, doc.name, decode=True).get(“file_url”)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 118, in save_file
fname = get_file_name(fname, content_hash[-6:])
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 254, in get_file_name
if len(n_records) > 0 or os.path.exists(get_files_path(fname.encode(‘utf-8’))):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/init.py”, line 279, in get_files_path
return get_site_path(“public”, “files”, *path)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/init.py”, line 276, in get_site_path
return get_path(base=get_site_base_path(), *path)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/init.py”, line 270, in get_path
return os.path.join(base, *path)
File “/home/erpnext/frappe-bench/env/lib/python2.7/posixpath.py”, line 80, in join
path += ‘/’ + b
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 3: ordinal not in range(128)

Heres the Lögä.png File:

ha! here it works! So there is already a solution somewhere.

Thanks for the test. Will look into the issue. This forum is not on frappe :smile: (yet!!)

The traceback you sent doesn’t look from https://demo.frappecloud.com

Traceback from frappecloud.com:

Traceback (innermost last):
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 175, in save
self.insert()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 145, in insert
self._validate()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 262, in _validate
self._extract_images_from_text_editor()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 401, in _extract_images_from_text_editor
extract_images_from_html(self, df.fieldname)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 102, in extract_images_from_html
content = re.sub(’ File “/home/frappe/press/benches/1412021012/env/lib64/python2.7/re.py”, line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 95, in _save_file
file_url = save_file(filename, content, doc.doctype, doc.name, decode=True).get(“file_url”)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 118, in save_file
fname = get_file_name(fname, content_hash[-6:])
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 254, in get_file_name
if len(n_records) > 0 or os.path.exists(get_files_path(fname.encode(‘utf-8’))):
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/init.py”, line 279, in get_files_path
return get_site_path(“public”, “files”, *path)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/init.py”, line 276, in get_site_path
return get_path(base=get_site_base_path(), *path)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/init.py”, line 270, in get_path
return os.path.join(base, *path)
File “/home/frappe/press/benches/1412021012/env/lib64/python2.7/posixpath.py”, line 80, in join
path += ‘/’ + b
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xcc in position 3: ordinal not in range(128)

Traceback (innermost last):
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/app.py”, line 49, in application
response = frappe.handler.handle()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/handler.py”, line 66, in handle
execute_cmd(cmd)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/handler.py”, line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/init.py”, line 531, in call
return fn(*args, **newargs)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 175, in save
self.insert()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 145, in insert
self._validate()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 262, in _validate
self._extract_images_from_text_editor()
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/model/document.py”, line 401, in _extract_images_from_text_editor
extract_images_from_html(self, df.fieldname)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 102, in extract_images_from_html
content = re.sub(’ File “/home/frappe/press/benches/1412021012/env/lib64/python2.7/re.py”, line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 95, in _save_file
file_url = save_file(filename, content, doc.doctype, doc.name, decode=True).get(“file_url”)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 118, in save_file
fname = get_file_name(fname, content_hash[-6:])
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/file_manager.py”, line 254, in get_file_name
if len(n_records) > 0 or os.path.exists(get_files_path(fname.encode(‘utf-8’))):
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/init.py”, line 279, in get_files_path
return get_site_path(“public”, “files”, *path)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/init.py”, line 276, in get_site_path
return get_path(base=get_site_base_path(), *path)
File “/home/frappe/press/benches/1412021012/apps/frappe/frappe/utils/init.py”, line 270, in get_path
return os.path.join(base, *path)
File “/home/frappe/press/benches/1412021012/env/lib64/python2.7/posixpath.py”, line 80, in join
path += ‘/’ + b
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xcc in position 3: ordinal not in range(128)