]> granicus.if.org Git - python/commitdiff
Make the binhex test pass on Darwin.
authorGuido van Rossum <guido@python.org>
Sun, 27 May 2007 09:20:49 +0000 (09:20 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 27 May 2007 09:20:49 +0000 (09:20 +0000)
Grr.  Do we really want to support this module?

Lib/binhex.py

index ac1cb18a0f3db2742f1f19caa0ce58abb6639e82..a8abf1b627abd71171124f7f39867ef0158e71d7 100644 (file)
@@ -191,8 +191,8 @@ class BinHex:
         nl = len(name)
         if nl > 63:
             raise Error, 'Filename too long'
-        d = bytes(chr(nl)) + bytes(name) + b'\0'
-        d2 = bytes(finfo.Type, "latin-1") + bytes(finfo.Creator, "latin-1")
+        d = bytes([nl]) + bytes(name) + b'\0'
+        d2 = bytes(finfo.Type) + bytes(finfo.Creator)
 
         # Force all structs to be packed with big-endian
         d3 = struct.pack('>h', finfo.Flags)
@@ -420,8 +420,8 @@ class HexBin:
 
         self.FName = fname
         self.FInfo = FInfo()
-        self.FInfo.Creator = creator
-        self.FInfo.Type = type
+        self.FInfo.Creator = str8(creator)
+        self.FInfo.Type = str8(type)
         self.FInfo.Flags = flags
 
         self.state = _DID_HEADER