Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b282520

Browse files
committed
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.
1 parent f6f3a89 commit b282520

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/httplib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
v
2626
Unread-response [Response-headers-read]
2727
|\____________________
28-
| \
28+
| \
2929
| response.read() | putrequest()
3030
v v
3131
Idle Req-started-unread-response
@@ -332,7 +332,10 @@ def _set_hostport(self, host, port):
332332
if port is None:
333333
i = host.find(':')
334334
if i >= 0:
335-
port = int(host[i+1:])
335+
try:
336+
port = int(host[i+1:])
337+
except ValueError, msg:
338+
raise socket.error, str(msg)
336339
host = host[:i]
337340
else:
338341
port = self.default_port

0 commit comments

Comments
 (0)