From 66b10927fb531913e0b69779297b4d8fbfcc7e82 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 11 Sep 2020 13:35:11 +0530 Subject: [PATCH] py3 compat --- src/calibre/gui2/tweak_book/check_links.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/tweak_book/check_links.py b/src/calibre/gui2/tweak_book/check_links.py index eefa367c39..43c598dca9 100644 --- a/src/calibre/gui2/tweak_book/check_links.py +++ b/src/calibre/gui2/tweak_book/check_links.py @@ -30,6 +30,8 @@ def set_data(name, val): editors[name].replace_data(val, only_if_different=False) else: with current_container().open(name, 'wb') as f: + if isinstance(val, str): + val = val.encode('utf-8') f.write(val) get_boss().set_modified()