Message2663
| Author |
dealfaro |
| Recipients |
| Date |
2000年12月14日.04:45:35 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
In httplib.py, line 336, the following code appears:
def _set_hostport(self, host, port):
if port is None:
i = string.find(host, ':')
if i >= 0:
port = int(host[i+1:])
host = host[:i]
else:
port = self.default_port
self.host = host
self.port = port
Ths code breaks if the host string ends with ":", so that
int("") is called. In the old (1.5.2) version of this
module, the corresponding int () conversion used to be
enclosed in a try/except pair:
try: port = string.atoi(port)
except string.atoi_error:
raise socket.error, "nonnumeric port"
and this fixed the problem.
Note BTW that now the error reported by int is
"ValueError: invalid literal for int():"
rather than the above string.atoi_error.
I found this problem while downloading web pages,
but unfortunately I cannot pinpoint which page
caused the problem.
Luca de Alfaro |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 13:52:28 | admin | link | issue225744 messages |
| 2007年08月23日 13:52:28 | admin | create |
|