mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 compat
This commit is contained in:
parent
3946727192
commit
66b10927fb
@ -30,6 +30,8 @@ def set_data(name, val):
|
|||||||
editors[name].replace_data(val, only_if_different=False)
|
editors[name].replace_data(val, only_if_different=False)
|
||||||
else:
|
else:
|
||||||
with current_container().open(name, 'wb') as f:
|
with current_container().open(name, 'wb') as f:
|
||||||
|
if isinstance(val, str):
|
||||||
|
val = val.encode('utf-8')
|
||||||
f.write(val)
|
f.write(val)
|
||||||
get_boss().set_modified()
|
get_boss().set_modified()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user