Re: urllib interpretation of URL with ".."

2007-06-27 Thread sergio
Gabriel Genellina wrote: > En Tue, 26 Jun 2007 17:26:06 -0300, sergio <[EMAIL PROTECTED]> > escribió: > >> John Nagle wrote: >> >>> In Python, of course, "urlparse.urlparse", which is >>> the main function used to disassemble a URL, has no idea whether it's >>> being used by a client or a server

Re: urllib interpretation of URL with ".."

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 17:26:06 -0300, sergio <[EMAIL PROTECTED]> escribió: > John Nagle wrote: > >> In Python, of course, "urlparse.urlparse", which is >> the main function used to disassemble a URL, has no idea whether it's >> being used by a client or a server, so it, reasonably enough, takes

Re: urllib interpretation of URL with ".."

2007-06-26 Thread sergio
John Nagle wrote: > In Python, of course, "urlparse.urlparse", which is > the main function used to disassemble a URL, has no idea whether it's > being used by a client or a server, so it, reasonably enough, takes option > 1. >>> import urlparse >>> base="http://somesite.com/level1/"; >>> path="

Re: urllib interpretation of URL with ".."

2007-06-25 Thread John J. Lee
John Nagle <[EMAIL PROTECTED]> writes: > Duncan Booth wrote: >> "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> >> Is "urllib" wrong? > >> Section 5.2 is also relevant here. In particular: >> >> >>> g) If the resulting buffer string still begins with one or more >>> complete path

Re: urllib interpretation of URL with ".."

2007-06-25 Thread John Nagle
Duncan Booth wrote: > "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > >>>Is "urllib" wrong? > Section 5.2 is also relevant here. In particular: > > >> g) If the resulting buffer string still begins with one or more >> complete path segments of "..", then the reference is >>

Re: urllib interpretation of URL with ".."

2007-06-25 Thread Duncan Booth
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> Is "urllib" wrong? > > I can't see how. HTTP 1.1 says that the parameter to the GET > request should be an abs_path; RFC 2396 says that > /../acatalog/shop.html is indeed an abs_path, as .. is a valid > segment. That RFC also has a section on relati

Re: urllib interpretation of URL with ".."

2007-06-23 Thread John Nagle
Martin v. Löwis wrote: > John Nagle schrieb: > >>Here's a URL, found in a link, which gives us trouble >>when we try to follow the link: >> >>http://sportsbra.co.uk/../acatalog/shop.html >> >>Browsers immediately turn this into >> >>http://sportsbra.co.uk/acatalog/shop.html >> >>and go fro

Re: urllib interpretation of URL with ".."

2007-06-23 Thread Martin v. Löwis
John Nagle schrieb: > Here's a URL, found in a link, which gives us trouble > when we try to follow the link: > > http://sportsbra.co.uk/../acatalog/shop.html > > Browsers immediately turn this into > > http://sportsbra.co.uk/acatalog/shop.html > > and go from there, but urllib tries to

urllib interpretation of URL with ".."

2007-06-22 Thread John Nagle
Here's a URL, found in a link, which gives us trouble when we try to follow the link: http://sportsbra.co.uk/../acatalog/shop.html Browsers immediately turn this into http://sportsbra.co.uk/acatalog/shop.html and go from there, but urllib tries to open it explicitly, which resul