From d95cc754836762be6571aa44bcad1a01cf6def1d Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Sun, 8 Aug 2010 11:27:53 +0000 Subject: 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. --- Lib/test/test_urllib2net.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/test/test_urllib2net.py') diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index ff7c7bff64..8b9435ac60 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -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 -- cgit v1.2.1