Changes to urlparse.py: urljoin

Gerrit Holl gerrit.holl at pobox.com
Mon Feb 14 15:09:59 CET 2000


Ronald Hiller wrote on 950479787:
> I've been having some problems with the urljoin function.  When I try
> and join URLs that have '..' components that make the path above the
> root, they aren't joined properly.
> 
> For example:
> 
> goof> python
> Python 1.5.2 (#1, Oct 24 1999, 20:24:11)  [GCC 2.8.1] on sunos5
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import urlparse
> >>> urlparse.urljoin("http://www.xyz.com", "../x/y/z.gif")
> 'http://www.xyz.com/../x/y/z.gif'
> >>>
> 
> # Now with the changes:
> > python
> Python 1.5.2 (#1, Oct 24 1999, 20:24:11)  [GCC 2.8.1] on sunos5
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import urlparse
> >>> urlparse.urljoin("http://www.xyz.com", "../x/y/z.gif")
> 'http://www.xyz.com/x/y/z.gif'
> >>>
> 
> My patches for urlparse are included below...do they look reasonable?
> What is the process for getting these into the "real" source tree?

Have a look at:

    http://www.python.org/patches/

regards,
Gerrit.

-- 
Homepage: http://www.nl.linux.org/~gerrit
-----BEGIN GEEK CODE BLOCK----- http://www.geekcode.com
Version: 3.12
GCS dpu s-:-- a14 C++++>$ UL++ P--- L+++ E--- W++ N o? K? w--- !O
!M !V PS+ PE? Y? PGP-- t- 5? X? R- tv- b+(++) DI D+ G++ !e !r !y
-----END GEEK CODE BLOCK----- moc.edockeeg.www//:ptth




More information about the Python-list mailing list