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
da3f2287
Commit
da3f2287
authored
Aug 29, 2007
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert various string literals to bytes.
parent
c4140a15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Lib/binhex.py
Lib/binhex.py
+3
-3
Lib/test/test_httplib.py
Lib/test/test_httplib.py
+2
-2
Lib/wave.py
Lib/wave.py
+1
-1
No files found.
Lib/binhex.py
View file @
da3f2287
...
...
@@ -38,7 +38,7 @@ class Error(Exception):
# Various constants
REASONABLY_LARGE
=
32768
# Minimal amount we pass the rle-coder
LINELEN
=
64
RUNCHAR
=
chr
(
0x90
)
# run-length introducer
RUNCHAR
=
b"
\
x90
"
#
# This code is no longer byte-order dependent
...
...
@@ -351,11 +351,11 @@ class _Rledecoderengine:
# otherwise: keep 1 byte.
#
mark
=
len
(
self
.
pre_buffer
)
if
self
.
pre_buffer
[
-
3
:]
==
RUNCHAR
+
'
\
0
'
+
RUNCHAR
:
if
self
.
pre_buffer
[
-
3
:]
==
RUNCHAR
+
b
'
\
0
'
+
RUNCHAR
:
mark
=
mark
-
3
elif
self
.
pre_buffer
[
-
1
]
==
RUNCHAR
:
mark
=
mark
-
2
elif
self
.
pre_buffer
[
-
2
:]
==
RUNCHAR
+
'
\
0
'
:
elif
self
.
pre_buffer
[
-
2
:]
==
RUNCHAR
+
b
'
\
0
'
:
mark
=
mark
-
2
elif
self
.
pre_buffer
[
-
2
]
==
RUNCHAR
:
pass
# Decode all
...
...
Lib/test/test_httplib.py
View file @
da3f2287
...
...
@@ -31,13 +31,13 @@ class NoEOFStringIO(io.BytesIO):
"""
def
read
(
self
,
n
=-
1
):
data
=
io
.
BytesIO
.
read
(
self
,
n
)
if
data
==
''
:
if
data
==
b
''
:
raise
AssertionError
(
'caller tried to read past EOF'
)
return
data
def
readline
(
self
,
length
=
None
):
data
=
io
.
BytesIO
.
readline
(
self
,
length
)
if
data
==
''
:
if
data
==
b
''
:
raise
AssertionError
(
'caller tried to read past EOF'
)
return
data
...
...
Lib/wave.py
View file @
da3f2287
...
...
@@ -84,7 +84,7 @@ _array_fmts = None, 'b', 'h', None, 'l'
# Determine endian-ness
import
struct
if
struct
.
pack
(
"h"
,
1
)
==
"
\
000
\
001
"
:
if
struct
.
pack
(
"h"
,
1
)
==
b
"
\
000
\
001
"
:
big_endian
=
1
else
:
big_endian
=
0
...
...
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