[issue11703] Bug in python >= 2.7 with urllib2 fragment

Ivan Ivanenko report at bugs.python.org
Mon Mar 28 23:23:32 CEST 2011


New submission from Ivan Ivanenko <ivan.ivanenko at gmail.com>:

result = urllib.urlopen("http://docs.python.org/library/urllib.html#OK")
print result.geturl()

result = urllib2.urlopen("http://docs.python.org/library/urllib.html#OK")
print result.geturl()

Python 2.6 returns:
"http://docs.python.org/library/urllib.html#OK"
"http://docs.python.org/library/urllib.html#OK"

Python 2.7 returns:
"http://docs.python.org/library/urllib.html#OK"
"http://docs.python.org/library/urllib.html"

2to3 -w test.py
Python 3 returns:
"http://docs.python.org/library/urllib.html"
"http://docs.python.org/library/urllib.html"

I expect geturl() result with "#OK" in all cases

----------
components: Library (Lib)
messages: 132423
nosy: Ivan.Ivanenko
priority: normal
severity: normal
status: open
title: Bug in python >= 2.7 with urllib2 fragment
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11703>
_______________________________________


More information about the Python-bugs-list mailing list