summaryrefslogtreecommitdiffstats
path: root/Lib/binhex.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-27 20:40:10 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-27 20:40:10 (GMT)
commit09549f44076e84083cbb15dbd6da9d1a3fd6d7f1 (patch)
tree311dfe57d4e326137b0435846cd07c3d717f26d0 /Lib/binhex.py
parent739e2ad64bc2a5a345723a23ca01fa6b54ba1c9f (diff)
downloadcpython-09549f44076e84083cbb15dbd6da9d1a3fd6d7f1.zip
cpython-09549f44076e84083cbb15dbd6da9d1a3fd6d7f1.tar.gz
cpython-09549f44076e84083cbb15dbd6da9d1a3fd6d7f1.tar.bz2
Changes in anticipation of stricter str vs. bytes enforcement.
Diffstat (limited to 'Lib/binhex.py')
-rw-r--r--Lib/binhex.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/binhex.py b/Lib/binhex.py
index 8da8961..0dfa475 100644
--- a/Lib/binhex.py
+++ b/Lib/binhex.py
@@ -191,8 +191,8 @@ class BinHex:
nl = len(name)
if nl > 63:
raise Error, 'Filename too long'
- d = bytes([nl]) + bytes(name) + b'\0'
- d2 = bytes(finfo.Type) + bytes(finfo.Creator)
+ d = bytes([nl]) + name.encode("latin-1") + b'\0'
+ d2 = bytes(finfo.Type, "ascii") + bytes(finfo.Creator, "ascii")
# Force all structs to be packed with big-endian
d3 = struct.pack('>h', finfo.Flags)