Merge pull request #5176 from achillesrasquinha/py3
read bytes instead of string
This commit is contained in:
commit
ffb7151e46
1 changed files with 1 additions and 1 deletions
|
|
@ -173,7 +173,7 @@ class File(NestedSet):
|
|||
|
||||
if self.file_url.startswith("/files/"):
|
||||
try:
|
||||
with open(get_files_path(self.file_name.lstrip("/")), "r") as f:
|
||||
with open(get_files_path(self.file_name.lstrip("/")), "rb") as f:
|
||||
self.content_hash = get_content_hash(f.read())
|
||||
except IOError:
|
||||
frappe.msgprint(_("File {0} does not exist").format(self.file_url))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue