[issue754016] urlparse goes wrong with IP:port without scheme

2019-10-18 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 0f3187c1ce3b3ace60f6c1691dfa3d4e744f0384 by Senthil Kumaran in 
branch '3.8':
[3.8] bpo-27657: Fix urlparse() with numeric paths (GH-661) (#16839)
https://github.com/python/cpython/commit/0f3187c1ce3b3ace60f6c1691dfa3d4e744f0384


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2019-10-18 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
pull_requests: +16389
pull_request: https://github.com/python/cpython/pull/16839

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2019-10-18 Thread miss-islington


miss-islington  added the comment:


New changeset 82b5f6b16e051f8a2ac6e87ba86b082fa1c4a77f by Miss Islington (bot) 
in branch '3.7':
bpo-27657: Fix urlparse() with numeric paths (GH-661)
https://github.com/python/cpython/commit/82b5f6b16e051f8a2ac6e87ba86b082fa1c4a77f


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2019-10-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16383
pull_request: https://github.com/python/cpython/pull/16837

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2019-10-18 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 5a88d50ff013a64fbdb25b877c87644a9034c969 by Senthil Kumaran (Tim 
Graham) in branch 'master':
bpo-27657: Fix urlparse() with numeric paths (#661)
https://github.com/python/cpython/commit/5a88d50ff013a64fbdb25b877c87644a9034c969


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2017-03-13 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2017-03-13 Thread Tim Graham

Changes by Tim Graham :


--
pull_requests: +544

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2010-08-03 Thread David Stanek

David Stanek dsta...@dstanek.com added the comment:

I've reworked the patch so that it applied against the py3k branch. It's been 
attached to this issue and is also available here: 
http://codereview.appspot.com/1910044.

--
nosy: +dstanek
Added file: http://bugs.python.org/file18362/754016.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2010-08-03 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

Fixed in revision 83700 (release27-maint). r83701(py3k) and 
r83702(release31-maint).

David, thanks for reworking on the patch. Couple of comments
- I made change to the original patch where I checked 'https:' and 'http:' kind 
of url with url.endswith(':')  instead of len(url) == i+1 // I had a hard time 
to figure out why I had this way in the first place.

- In py3k, the urlparse.urlparse is changed to urllib.parse.urlparse. So that 
changes were required in the tests.

--
assignee: facundobatista - orsenthil
resolution: accepted - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2010-07-14 Thread Mark Lawrence

Mark Lawrence breamore...@yahoo.co.uk added the comment:

The patch will need to be reworked for the 2.7, 3.1 and 3.2 branches.

--
nosy: +BreamoreBoy
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2009-02-12 Thread Daniel Diniz

Changes by Daniel Diniz aja...@gmail.com:


--
nosy: +jjlee
stage:  - patch review
type:  - behavior
versions: +Python 2.6 -Python 2.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-07-02 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

I think this last patch is ok, but the third case that was raised in the
web-sig should be addressed:


There's even a 3rd case: HTTP's Request-URI. For example, '//path' must
be treated as an abs_path consisting of two path_segments ['', 'path'],
not a net_loc, since the Request_URI must be one of (* | absoluteURI |
abs_path | authority).


Please, address this new detail, and I'd commit this. Thanks!

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-27 Thread Senthil

Senthil [EMAIL PROTECTED] added the comment:

I am attaching the modified patch, which addresses the port issue
properly and handles 'http:', 'https:' only URLS. Also included the
tests for it.

Facundo, I gave sufficient thought on raising an Exception for URLS not
staring with '//', and I am -1 for it.

As urlparse module is used for handling both absolute URLs as well as
relative URLS, this suggestion IMHO, would break the urlparse handling
of all relative urls. For e.g, cases which are mentioned in the RFC 1808
(Section 5.1 Normal Examples).

The way to inform the users to use '//net_loc' when they want net_loc,
would be Docs/Help message (included in the patch) and otherwise
urlparse following RFC1808, will treat it as the path.

This case may seem absurd when 'www.python.org' is treated as path but
perfect for parsing relative urls like just 'a'. More over this makes
sense when we have relative urls with parameters and query, for
e.g.'g:h','?x'

Another way to handle this would be split urlparse into two methods:
urlparse.absparse()
urlparse.relparse() 
and let the user decide what he wants to do.
I am passing a message to Web-SIG to discuss this further.

Irrespective of this, if the patch looks okay for handling the port
issue for 2.6 with the Doc/Help message, then we should close this
bug and take the discussion further in Web-SIG. (I shall provide the
patch for 3.0 as well)

Comments Please.

Added file: http://bugs.python.org/file10752/issue754016-py26.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-21 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

Senthil, your patch is wrong, see:

 import urlparse
 urlparse.urlparse('1.2.3.4:80','http')
ParseResult(scheme='http', netloc='', path='1.2.3.4:80', params='',
query='', fragment='')

The netloc should be 1.2.3.4:80, note the composition of an URL:

  scheme://netloc/path;params?query#fragment

Please fix it and test it applying the patch to the test I'm submitting
here...

Added file: http://bugs.python.org/file10686/test_urlparse.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-21 Thread Anthony Lenton

Anthony Lenton [EMAIL PROTECTED] added the comment:

I agree with facundobatista that the patch is bad, but for a different
reason: it now breaks with:

 import urlparse
 urlparse.urlparse ('http:')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/anthony/svn/python26/Lib/urlparse.py, line 108, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
  File /home/anthony/svn/python26/Lib/urlparse.py, line 148, in urlsplit
if i  0 and not url[i+1].isdigit():
IndexError: string index out of range

I'm afraid that it it's not evident that the expected behavior isn't
evident.

Take for example:

 import urlparse
 urlparse.urlparse('some.com', 'http')
ParseResult(scheme='http', netloc='', path='some.com', params='',
query='', fragment='')

Is the url referring to the some.com domain or to a windows executable file?

If you're using urlparse to parse only absolute urls then probably you
want the first component to be considered a net_loc, but not if you're
thinking of accepting also relative urls.

It would probably be better to be explicit and raise an exception if the
url is invalid, so that the user can prepend a '//' and resubmit if
needed.  Also we'd probably stop seeing bugreports about this issue :)

--
nosy: +elachuni

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-21 Thread Facundo Batista

Changes by Facundo Batista [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file10686/test_urlparse.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-21 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

I agree with Anthony here, because if you let people write without the
// at the beginning, you'll never know if they're entering a net
location or a relative path.

So, the better behaviour to be as explicit as possible should be:

 urlparse.urlparse('1.2.3.4:80','http')
Traceback!!! ValueError(nice message here)

 urlparse.urlparse('//1.2.3.4:80','http')
('http', '1.2.3.4:80', '', '', '', '')


So, to close this issue, we should fix the code to behave like indicated
in the first case.

What do you think?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-19 Thread Facundo Batista

Changes by Facundo Batista [EMAIL PROTECTED]:


--
assignee: georg.brandl - facundobatista

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue754016] urlparse goes wrong with IP:port without scheme

2008-06-09 Thread Senthil

Senthil [EMAIL PROTECTED] added the comment:

Attaching the patch to fix this issue. I deliberated upon this for a
while and came up with the approach to:

1) fix the port issue, wherein urlparse should technically recognize the 
':' separator for port from ':' after scheme.

2) And Doc fix wherein, it is advised that in the absence of a scheme,
use the net_loc as //net_loc (following RCF 1808).

If we go for any other fix, like internally pre-pending // when user has
not specified the scheme (like in many pratical purpose), then we stand
at chance of breaking a number of tests ( cases where url is 'g'(path
only),';x' (path with params) and cases where relative url is g:h)

Let me know your thoughts on this.

 urlparse('1.2.3.4:80')
ParseResult(scheme='', netloc='', path='1.2.3.4:80', params='',
query='', fragment='')
 urlparse('http://www.python.org:80/~guido/foo?query#fun')
ParseResult(scheme='http', netloc='www.python.org:80',
path='/~guido/foo', params='', query='query', fragment='fun')


--
keywords: +patch
nosy: +orsenthil
Added file: http://bugs.python.org/file10570/issue754016.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue754016
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com