[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Antoine Pitrou added the comment: For the record, urlparse still doesn't handle bare tel URIs such as tel:1234: parse.urlparse(tel:1234) ParseResult(scheme='', netloc='', path='tel:1234', params='', query='', fragment='') This is not terribly important since these URLs are not RFC 3966-compliant (a tel URI must have either a global number starting with + - e.g. tel:+1234 - or a local number with a phone-context parameter - e.g. tel:1234;phone-context=python.org). Yet, there actual telecom systems producing such non-compliant URIs, so they might be nice to support too. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Ezio Melotti ezio.melo...@gmail.com added the comment: According to RFC 1808 [0], the netloc must follow //, so this doesn't seem to apply to 'tel' URIs. [0]: http://tools.ietf.org/html/rfc1808.html#section-2.1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset ff0fd7b26219 by Ezio Melotti in branch '2.7': #14072: Fix parsing of tel URIs in urlparse by making the check for ports stricter. http://hg.python.org/cpython/rev/ff0fd7b26219 New changeset 9f6b7576c08c by Ezio Melotti in branch '3.2': #14072: Fix parsing of tel URIs in urlparse by making the check for ports stricter. http://hg.python.org/cpython/rev/9f6b7576c08c New changeset b78c67665a7f by Ezio Melotti in branch 'default': #14072: merge with 3.2. http://hg.python.org/cpython/rev/b78c67665a7f -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Senthil Kumaran sent...@uthcode.com added the comment: Hi Ezio, The patch is fine and the check is correct. I was thinking if by removing int() based verification are we missing out anything on port number check. But looks like we wont as the int() previously is done to find the proper scheme and url part for the applicable cases. In addition to changes in the patch, I think, it would helpful to add 'tel' to uses_netloc in the classification at the top of the module. Thanks! -- assignee: orsenthil - ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Éric Araujo mer...@netwok.org added the comment: it would helpful to add 'tel' to uses_netloc How so? The tel scheme does not use a netloc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Ezio Melotti ezio.melo...@gmail.com added the comment: In the patch I'm assuming that the port number can only contain ascii digits RFC 3986 [0] defines the port as port = *DIGIT and part of the authority [1] as authority = [ userinfo @ ] host [ : port ] userinfo = *( unreserved / pct-encoded / sub-delims / : ) host = IP-literal / IPv4address / reg-name port = *DIGIT so my assumption should be correct. [0]: http://tools.ietf.org/html/rfc3986#section-3.2.3 [1]: http://tools.ietf.org/html/rfc3986#appendix-A -- stage: patch review - commit review versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
R. David Murray rdmur...@bitdance.com added the comment: See also issue 14036. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Ezio Melotti ezio.melo...@gmail.com added the comment: Here's a possible patch. The problem is that urlsplit (in Lib/urllib/parse.py:348) tries to convert the part after the : (in this case +31-641044153 and +31641044153) to int to see if it's a port number. This doesn't work with +31-641044153, but it does with +31-641044153. In the patch I'm assuming that the port number can only contain ascii digits (no leading '+/-', no spaces, no non-ascii digits) and checking for it explicitly, rather than using int() in a try/except. -- keywords: +patch nosy: +ezio.melotti stage: - patch review Added file: http://bugs.python.org/file25486/issue14072.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Éric Araujo mer...@netwok.org added the comment: urlparse doesn’t actually implement generic parsing rules according to the most recent RFCs; it has hard-coded registries of supported schemes. tel is not currently supported. That said, it’s strange that the parsing differs in your two examples. -- components: +Library (Lib) -None nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Changes by Ivan Herman ivan.her...@cwi.nl: -- components: None nosy: ivan_herman priority: normal severity: normal status: open title: urlparse on tel: URI-s misses the scheme in some cases type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
New submission from Ivan Herman ivan.her...@cwi.nl: I think that the screen dump below is fairly clear: 10:41 Ivan python Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type help, copyright, credits or license for more information. import urlparse x = tel:+31-641044153 urlparse.urlparse(x) ParseResult(scheme='tel', netloc='', path='+31-641044153', params='', query='', fragment='') y = tel:+31641044153 urlparse.urlparse(y) ParseResult(scheme='', netloc='', path='tel:+31641044153', params='', query='', fragment='') It seems that, when the phone number does not have any separator character, the parsing goes wrong (separators are not required per RFC 3966) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14072] urlparse on tel: URI-s misses the scheme in some cases
Changes by Senthil Kumaran sent...@uthcode.com: -- assignee: - orsenthil nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com