Index: Lib/plat-mac/buildtools.py =================================================================== --- Lib/plat-mac/buildtools.py (revision 57912) +++ Lib/plat-mac/buildtools.py (working copy) @@ -17,7 +17,8 @@ warnings.warn("the buildtools module is deprecated", DeprecationWarning, 2) -BuildError = "BuildError" +class BuildError(BaseException): + pass # .pyc file (and 'PYC ' resource magic number) MAGIC = imp.get_magic() Index: Lib/plat-mac/bundlebuilder.py =================================================================== --- Lib/plat-mac/bundlebuilder.py (revision 57912) +++ Lib/plat-mac/bundlebuilder.py (working copy) @@ -180,8 +180,9 @@ assert len(self.type) == len(self.creator) == 4, \ "type and creator must be 4-byte strings." pkginfo = pathjoin(contents, "PkgInfo") + data = bytes(self.type + self.creator, encoding='ascii') f = open(pkginfo, "wb") - f.write(self.type + self.creator) + f.write(data) f.close() # # Write Contents/Info.plist