mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-12 14:58:24 +00:00
log encoding exception
This commit is contained in:
committed by
Rohit Waghchaure
parent
9e0762e8c2
commit
eb87566fa6
@@ -40,10 +40,15 @@ class ImportSupplierInvoice(Document):
|
||||
taxes = []
|
||||
terms = []
|
||||
encoded_content = zf.read(file_name)
|
||||
|
||||
try:
|
||||
content = encoded_content.decode("utf-8-sig")
|
||||
except UnicodeDecodeError:
|
||||
content = encoded_content.decode("utf-16")
|
||||
try:
|
||||
content = encoded_content.decode("utf-16")
|
||||
except UnicodeDecodeError as e:
|
||||
frappe.log_error(message=e, title="UTF-16 encoding error for File Name: " + file_name)
|
||||
|
||||
file_content = bs(content, "xml")
|
||||
|
||||
for line in file_content.find_all("DatiTrasmissione"):
|
||||
|
||||
Reference in New Issue
Block a user