From 09549f44076e84083cbb15dbd6da9d1a3fd6d7f1 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 27 Aug 2007 20:40:10 +0000 Subject: Changes in anticipation of stricter str vs. bytes enforcement. --- Lib/binhex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/binhex.py') diff --git a/Lib/binhex.py b/Lib/binhex.py index 8da8961d5b..0dfa475f44 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) -- cgit v1.2.1