Changes by Georg Brandl ge...@python.org:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8818
___
___
Python-bugs-list
New submission from AdamN a...@varud.com:
urlsplit and urlparse place the host into the path when using a default scheme:
(Pdb) urlsplit('regionalhelpwanted.com/browseads/?sn=2',scheme='http')
SplitResult(scheme='http', netloc='', path='regionalhelpwanted.com/browseads/',
query='sn=2',
Changes by AdamN a...@varud.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8818
___
___
Python-bugs-list mailing list
R. David Murray rdmur...@bitdance.com added the comment:
The keyword in the code is 'scheme'. I've updated the docs accordingly in
r81521 and r81522.
--
assignee: - d...@python
components: +Documentation -Library (Lib)
nosy: +d...@python, r.david.murray
resolution: - fixed
stage: -
AdamN a...@varud.com added the comment:
Great, thanks.
However urlsplit and urlparse still take what one would expect to be recognized
as the netloc and assigns it to the 'path' key. If that is by design perhaps
we should at least warn people?
--
status: closed - open
R. David Murray rdmur...@bitdance.com added the comment:
I've added Senthil as nosy to double check me, but my understanding is that the
scheme is just the part up to the colon. If you want to have a netloc in the
URL, you have to precede it with a '//'. Otherwise there's no netloc.
AdamN a...@varud.com added the comment:
Ok, you're right:
urlsplit('cnn.com')
SplitResult(scheme='', netloc='', path='cnn.com', query='', fragment='')
urlsplit('//cnn.com')
SplitResult(scheme='', netloc='cnn.com', path='', query='', fragment='')
Although I see that nowhere in the
Fred L. Drake, Jr. fdr...@acm.org added the comment:
On Tue, May 25, 2010 at 1:41 PM, AdamN rep...@bugs.python.org wrote:
Although I see that nowhere in the documentation.
It needn't be in the urlparse documentation; the RFCs on URL syntax
apply here. None of what's going on with the urlparse
AdamN a...@varud.com added the comment:
I appreciate what you're saying but nobody, I guarantee nobody, is using the
'//cnn.com' semantics.
Anyway, in RFC 3986 in the Syntax Components section, you'll see that the '://'
is not part of scheme or netloc. I could imagine urlsplit() failing if
Fred L. Drake, Jr. fdr...@acm.org added the comment:
The module is documented as supporting Relative Uniform Resource
Locators, in which a value with a non-rooted path is supported using
simply non/rooted/path.
See the third paragraph in the Python 2.6 documentation, starting The
module has
AdamN a...@varud.com added the comment:
I think I misspoke before. What I'm referring to is when somebody uses the
'scheme' parameter:
urlsplit('cnn.com',scheme='http')
Is there no way that we can document that this won't work the way that people
think it will? Is it really reasonable for
R. David Murray rdmur...@bitdance.com added the comment:
How would you expect urlsplit to differentiate between a relative path and a
path with a netloc? I would think that most people would expect the semantics
the module provides without reading any additional documentation. I certainly
AdamN a...@varud.com added the comment:
I would say right under:
urlparse.urlparse(urlstring[, default_scheme[, allow_fragments]])ΒΆ
Put:
urlstring is a pseudo-url. If the string has a scheme, it will be interpreted
as a scheme, followed by a path, querystring and fragment. If it is
Fred L. Drake, Jr. fdr...@acm.org added the comment:
On Tue, May 25, 2010 at 3:03 PM, AdamN rep...@bugs.python.org wrote:
I'm still confused about when anybody would use a relative path with a
default scheme and no netloc but I'll leave that decision to you guys.
The strings are not
14 matches
Mail list logo