summaryrefslogtreecommitdiffstats
path: root/Lib/bz2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/bz2.py')
-rw-r--r--Lib/bz2.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/bz2.py b/Lib/bz2.py
index ce07ebe..1da3ce6 100644
--- a/Lib/bz2.py
+++ b/Lib/bz2.py
@@ -311,6 +311,7 @@ def open(filename, mode="rb", compresslevel=9,
binary_file = BZ2File(filename, bz_mode, compresslevel=compresslevel)
if "t" in mode:
+ encoding = io.text_encoding(encoding)
return io.TextIOWrapper(binary_file, encoding, errors, newline)
else:
return binary_file