]> xmof Git - DeDRM.git/commitdiff
Fix launching help link from customization dialog.
authorJeremy Whiting <jpwhiting@kde.org>
Fri, 2 Oct 2020 06:17:47 +0000 (00:17 -0600)
committerJeremy Whiting <jpwhiting@kde.org>
Sun, 4 Oct 2020 04:36:35 +0000 (22:36 -0600)
To fix error with python3 when launching help link open files in binary
mode.

DeDRM_plugin/config.py

index ad6e82eb300305bfb746cbd82af179f8309d7d0d..68c6c288fb632011bac2b33a16502cf97b45f9f7 100644 (file)
@@ -153,7 +153,7 @@ class ConfigWidget(QWidget):
             # Copy the HTML helpfile to the plugin directory each time the
             # link is clicked in case the helpfile is updated in newer plugins.
             file_path = os.path.join(config_dir, "plugins", "DeDRM", "help", help_file_name)
-            with open(file_path,'w') as f:
+            with open(file_path,'wb') as f:
                 f.write(self.load_resource(help_file_name))
             return file_path
         url = 'file:///' + get_help_file_resource()
@@ -357,7 +357,7 @@ class ManageKeysDialog(QDialog):
             # link is clicked in case the helpfile is updated in newer plugins.
             help_file_name = "{0}_{1}_Help.htm".format(PLUGIN_NAME, self.key_type_name)
             file_path = os.path.join(config_dir, "plugins", "DeDRM", "help", help_file_name)
-            with open(file_path,'w') as f:
+            with open(file_path,'wb') as f:
                 f.write(self.parent.load_resource(help_file_name))
             return file_path
         url = 'file:///' + get_help_file_resource()