Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6dab7953
Commit
6dab7953
authored
Aug 27, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in anticipation of stricter str vs. bytes enforcement.
parent
39478e85
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Lib/plat-mac/Carbon/AppleEvents.py
Lib/plat-mac/Carbon/AppleEvents.py
+1
-1
Lib/plat-mac/aetypes.py
Lib/plat-mac/aetypes.py
+1
-1
Lib/plat-mac/plistlib.py
Lib/plat-mac/plistlib.py
+3
-3
No files found.
Lib/plat-mac/Carbon/AppleEvents.py
View file @
6dab7953
# 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'
)
...
...
Lib/plat-mac/aetypes.py
View file @
6dab7953
...
...
@@ -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"""
...
...
Lib/plat-mac/plistlib.py
View file @
6dab7953
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment