mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix Issue8280 - urllib2's Request method will remove fragements in the url.
This is how it should work,wget and curl work like this way too. Old behavior was wrong.
This commit is contained in:
parent
ad537f23e2
commit
d95cc75483
3 changed files with 19 additions and 1 deletions
|
@ -149,6 +149,13 @@ class OtherNetworkTests(unittest.TestCase):
|
|||
|
||||
## self._test_urls(urls, self._extra_handlers()+[bauth, dauth])
|
||||
|
||||
def test_urlwithfrag(self):
|
||||
urlwith_frag = "http://docs.python.org/glossary.html#glossary"
|
||||
req = urllib.request.Request(urlwith_frag)
|
||||
res = urllib.request.urlopen(req)
|
||||
self.assertEqual(res.geturl(),
|
||||
"http://docs.python.org/glossary.html")
|
||||
|
||||
def _test_urls(self, urls, handlers, retry=True):
|
||||
import time
|
||||
import logging
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue