This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urlparse.urljoin different behavior for different scheme
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Jasper.van.den.Bosch, ezio.melotti, orsenthil, python-dev
Priority: normal Keywords:

Created on 2011-08-02 22:15 by Jasper.van.den.Bosch, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg141581 - (view) Author: Jasper van den Bosch (Jasper.van.den.Bosch) Date: 2011-08-02 22:15
urlparse.urljoin successfully joins 'http://localhost/repo1' with a filename, but not 'svn://localhost/repo1' (only scheme different). But the documentation states that the svn: scheme is supported:
http://docs.python.org/library/urlparse.html

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from urlparse import urljoin
>>> urljoin('svn://localhost/repo1', 'xxx.xyz')
'xxx.xyz'
>>> urljoin('http://localhost/repo1', 'xxx.xyz')
'http://localhost/xxx.xyz'
msg141604 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-08-03 10:25
The reason for that seems that svn scheme did not support relative paths
to being with (at least when urlparse was originally written).

From 1.5 onwards (released sometime in 2008), it has the support for
relative urls and can work with urljoin (by giving relative paths).

http://subversion.apache.org/docs/release-notes/1.5.html#externals-relative-urls

Since the support was added in 2008 itself, I am okay to consider this
as a bug in Python and fix it in 2.7,3.2 and 3.3
msg141605 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-08-03 10:47
New changeset 5278aa2d9d9a by Senthil Kumaran in branch '2.7':
Fix closes issue12683 - urljoin to work with relative join of svn scheme.
http://hg.python.org/cpython/rev/5278aa2d9d9a

New changeset 57a836eb6916 by Senthil Kumaran in branch '3.2':
Fix closes issue12683 - urljoin to work with relative join of svn scheme.
http://hg.python.org/cpython/rev/57a836eb6916

New changeset a3981d0c4d9b by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix closes issue12683 - urljoin to work with relative join of svn scheme.
http://hg.python.org/cpython/rev/a3981d0c4d9b
History
Date User Action Args
2022-04-11 14:57:20adminsetgithub: 56892
2011-08-03 10:47:23python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg141605

resolution: fixed
stage: resolved
2011-08-03 10:25:09orsenthilsetmessages: + msg141604
2011-08-02 22:18:34ezio.melottisetnosy: + orsenthil, ezio.melotti

components: + Library (Lib), - None
versions: + Python 3.2, Python 3.3
2011-08-02 22:15:23Jasper.van.den.Boschcreate