summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/plat-mac/Carbon/AppleEvents.py2
-rw-r--r--Lib/plat-mac/aetypes.py2
-rw-r--r--Lib/plat-mac/plistlib.py6
3 files changed, 5 insertions, 5 deletions
diff --git a/Lib/plat-mac/Carbon/AppleEvents.py b/Lib/plat-mac/Carbon/AppleEvents.py
index 33ee3b3..ec19d19 100644
--- a/Lib/plat-mac/Carbon/AppleEvents.py
+++ b/Lib/plat-mac/Carbon/AppleEvents.py
@@ -1,6 +1,6 @@
# Generated from 'AEDataModel.h'
-def FOUR_CHAR_CODE(x): return bytes(x)
+def FOUR_CHAR_CODE(x): return x.encode("latin-1")
typeBoolean = FOUR_CHAR_CODE('bool')
typeChar = FOUR_CHAR_CODE('TEXT')
typeSInt16 = FOUR_CHAR_CODE('shor')
diff --git a/Lib/plat-mac/aetypes.py b/Lib/plat-mac/aetypes.py
index b4492ed..cf6e3b9 100644
--- a/Lib/plat-mac/aetypes.py
+++ b/Lib/plat-mac/aetypes.py
@@ -22,7 +22,7 @@ def _four_char_code(four_chars):
four_chars must contain only ASCII characters.
"""
- return bytes("%-4.4s" % str(four_chars))
+ return ("%-4.4s" % str(four_chars)).encode("latin-1")
class Unknown:
"""An uninterpreted AE object"""
diff --git a/Lib/plat-mac/plistlib.py b/Lib/plat-mac/plistlib.py
index ca7ac87..a107b26 100644
--- a/Lib/plat-mac/plistlib.py
+++ b/Lib/plat-mac/plistlib.py
@@ -176,7 +176,7 @@ class DumbXMLWriter:
line = line.encode('utf-8')
self.file.write(self.indentLevel * self.indent)
self.file.write(line)
- self.file.write('\n')
+ self.file.write(b'\n')
# Contents should conform to a subset of ISO 8601
@@ -220,14 +220,14 @@ def _escapeAndEncode(text):
return text.encode("utf-8") # encode as UTF-8
-PLISTHEADER = """\
+PLISTHEADER = b"""\
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
"""
class PlistWriter(DumbXMLWriter):
- def __init__(self, file, indentLevel=0, indent="\t", writeHeader=1):
+ def __init__(self, file, indentLevel=0, indent=b"\t", writeHeader=1):
if writeHeader:
file.write(PLISTHEADER)
DumbXMLWriter.__init__(self, file, indentLevel, indent)