New submission from Amrith Kumar:

The urlparse library incorrectly accepts a URI which specifies an invalid host 
identifier.

Example:

http://www.example.com:/abc

Looking at the URI specifications, this is an invalid URI.

By definition, you are supposed to specify a "hostport" and a hostport is 
defined as:

https://www.w3.org/Addressing/URL/uri-spec.html

hostport
    host [ : port ]

The BNF indicates that : is only valid if a port is also specified.

See current behavior; I submit to you that this should generate an exception.

https://gist.github.com/anonymous/8504f160ff90649890b5a2a82f8028b0

----------
components: Library (Lib)
messages: 282086
nosy: amrith
priority: normal
severity: normal
status: open
title: urlparse.urlparse() parses invalid URI without generating an error 
(examples provided)
type: behavior
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to