frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.32k stars 7.27k forks source link

Save_file don't support accented caractere #9416

Closed chafor closed 7 years ago

chafor commented 7 years ago

https://github.com/frappe/frappe/blob/develop/frappe/utils/file_manager.py#L148

File "/home/ubuntu/frappe-bench/apps/electronic_funds_transfer/electronic_funds_transfer/electronic_funds_transfer/doctype/electronic_funds_transfer/electronic_funds_transfer.py", line 89, in download_test
    save_file("file-bank-transfer.txt", str_save_file, self.doctype, self.name, is_private=True)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 158, in save_file
    content_hash = get_content_hash(content)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 338, in get_content_hash
    return hashlib.md5(content).hexdigest()
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc9' in position 138: ordinal not in range(128)
tundebabzy commented 7 years ago

Hello @chafor Please give some context regarding this issue

tundebabzy commented 7 years ago

Hi @chafor I'm closing this due to inactivity but please feel free to reopen if necessary.