From 865ee60d6e5813866423b4481ff5ed3411a1a7fe Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 13 Nov 2023 17:36:01 +0300 Subject: [PATCH] Fix(Py3): Open output text files in utf-8 encoding --- db2bkmk.py | 2 +- sort_db.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db2bkmk.py b/db2bkmk.py index 07e2756..4e50101 100755 --- a/db2bkmk.py +++ b/db2bkmk.py @@ -97,7 +97,7 @@ def run(): root_folder.walk_depth(Transl(transl_d)) - outfile = open(output_filename, 'w') + outfile = open(output_filename, 'w', encoding='utf-8') root_folder.walk_depth(writer(outfile, prune)) outfile.close() diff --git a/sort_db.py b/sort_db.py index 143c7d1..bcd3a8e 100755 --- a/sort_db.py +++ b/sort_db.py @@ -99,7 +99,7 @@ def run(): sys.stdout.write("Writing %s: " % output_filename) sys.stdout.flush() - outfile = open(output_filename, 'w') + outfile = open(output_filename, 'w', encoding='utf-8') writer = writer(outfile) writer.root_folder(root_folder) walk_linear(linear, writer) -- 2.39.5