SF Patch #103225 by Ping: httplib: smallest Python patch ever
The ASCII-art diagram at the top of httplib contains a backslash at the end of a line, which causes Python to remove the newline. This one-character patch adds a space after the backslash so it will appear at the end of the line in the docstring as intended.
This commit is contained in:
parent
f6f3a89fbd
commit
b2825205a2
@ -25,7 +25,7 @@ request. This diagram details these state transitions:
|
|||||||
v
|
v
|
||||||
Unread-response [Response-headers-read]
|
Unread-response [Response-headers-read]
|
||||||
|\____________________
|
|\____________________
|
||||||
| \
|
| \
|
||||||
| response.read() | putrequest()
|
| response.read() | putrequest()
|
||||||
v v
|
v v
|
||||||
Idle Req-started-unread-response
|
Idle Req-started-unread-response
|
||||||
@ -332,7 +332,10 @@ class HTTPConnection:
|
|||||||
if port is None:
|
if port is None:
|
||||||
i = host.find(':')
|
i = host.find(':')
|
||||||
if i >= 0:
|
if i >= 0:
|
||||||
port = int(host[i+1:])
|
try:
|
||||||
|
port = int(host[i+1:])
|
||||||
|
except ValueError, msg:
|
||||||
|
raise socket.error, str(msg)
|
||||||
host = host[:i]
|
host = host[:i]
|
||||||
else:
|
else:
|
||||||
port = self.default_port
|
port = self.default_port
|
||||||
|
Loading…
x
Reference in New Issue
Block a user