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.
v
Unread-response [Response-headers-read]
|\____________________
- | \
+ | \
| response.read() | putrequest()
v v
Idle Req-started-unread-response
if port is None:
i = host.find(':')
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]
else:
port = self.default_port