summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2011-10-19 00:04:46 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2011-10-19 00:04:46 (GMT)
commit6c4e1aed4b9ac08ee92d54d76063c3349757ca87 (patch)
treeac1c064a7eb8c9af8ec315acabbaf2c7cb97b267 /Lib/http
parent55c7e00fc031956216b5ce8aa20bebc2416ef723 (diff)
parenta5a9a9c3696af0a4a0df74618e63a4d47a62e00f (diff)
downloadcpython-6c4e1aed4b9ac08ee92d54d76063c3349757ca87.zip
cpython-6c4e1aed4b9ac08ee92d54d76063c3349757ca87.tar.gz
cpython-6c4e1aed4b9ac08ee92d54d76063c3349757ca87.tar.bz2
Merged fix for #10860 from 3.2
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/client.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index a490e2b..88da550 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -678,7 +678,10 @@ class HTTPConnection:
try:
port = int(host[i+1:])
except ValueError:
- raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
+ if host[i+1:] == "": # http://foo.com:/ == http://foo.com/
+ port = self.default_port
+ else:
+ raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
host = host[:i]
else:
port = self.default_port