Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9d38997e
Commit
9d38997e
authored
Mar 24, 2002
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add InvalidURL exception - raised if port is given but empty or non-numeric
parent
1ce0073a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Lib/httplib.py
Lib/httplib.py
+7
-1
No files found.
Lib/httplib.py
View file @
9d38997e
...
...
@@ -347,7 +347,10 @@ class HTTPConnection:
if
port
is
None
:
i
=
host
.
find
(
':'
)
if
i
>=
0
:
port
=
int
(
host
[
i
+
1
:])
try
:
port
=
int
(
host
[
i
+
1
:])
except
ValueError
:
raise
InvalidURL
,
"nonnumeric port: '%s'"
%
host
[
i
+
1
:]
host
=
host
[:
i
]
else
:
port
=
self
.
default_port
...
...
@@ -808,6 +811,9 @@ class HTTPException(Exception):
class
NotConnected
(
HTTPException
):
pass
class
InvalidURL
(
HTTPException
):
pass
class
UnknownProtocol
(
HTTPException
):
def
__init__
(
self
,
version
):
self
.
version
=
version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment