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
04319c78
Commit
04319c78
authored
Aug 04, 2007
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure LineAndFileWrapper gets bytes() as its first argument.
This change fixes a test in test_urllib.
parent
4e7855d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Lib/httplib.py
Lib/httplib.py
+5
-3
No files found.
Lib/httplib.py
View file @
04319c78
...
...
@@ -340,7 +340,7 @@ class HTTPResponse:
self
.
will_close
=
_UNKNOWN
# conn will close at end of response
def
_read_status
(
self
):
# Initialize with Simple-Response defaults
# Initialize with Simple-Response defaults
.
line
=
str
(
self
.
fp
.
readline
(),
"iso-8859-1"
)
if
self
.
debuglevel
>
0
:
print
(
"reply:"
,
repr
(
line
))
...
...
@@ -363,8 +363,10 @@ class HTTPResponse:
self
.
close
()
raise
BadStatusLine
(
line
)
else
:
# assume it's a Simple-Response from an 0.9 server
self
.
fp
=
LineAndFileWrapper
(
line
,
self
.
fp
)
# Assume it's a Simple-Response from an 0.9 server.
# We have to convert the first line back to raw bytes
# because self.fp.readline() needs to return bytes.
self
.
fp
=
LineAndFileWrapper
(
bytes
(
line
),
self
.
fp
)
return
"HTTP/0.9"
,
200
,
""
# The status code is a three-digit number
...
...
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