Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff12e08

Browse files
committed
Make the binhex test pass on Darwin.
Grr. Do we really want to support this module?
1 parent a01a8b6 commit ff12e08

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/binhex.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def _writeinfo(self, name, finfo):
191191
nl = len(name)
192192
if nl > 63:
193193
raise Error, 'Filename too long'
194-
d = bytes(chr(nl)) + bytes(name) + b'\0'
195-
d2 = bytes(finfo.Type, "latin-1") + bytes(finfo.Creator, "latin-1")
194+
d = bytes([nl]) + bytes(name) + b'\0'
195+
d2 = bytes(finfo.Type) + bytes(finfo.Creator)
196196

197197
# Force all structs to be packed with big-endian
198198
d3 = struct.pack('>h', finfo.Flags)
@@ -420,8 +420,8 @@ def _readheader(self):
420420

421421
self.FName = fname
422422
self.FInfo = FInfo()
423-
self.FInfo.Creator = creator
424-
self.FInfo.Type = type
423+
self.FInfo.Creator = str8(creator)
424+
self.FInfo.Type = str8(type)
425425
self.FInfo.Flags = flags
426426

427427
self.state = _DID_HEADER

0 commit comments

Comments
 (0)