[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2019-04-26 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-07 Thread karl
karl added the comment: OK I fixed the code. The issue is here https://hg.python.org/cpython/file/1e1c6e306eb4/Lib/urllib/request.py#l656 newurl = urlunparse(urlparts) Basically it reinjects the fragment in the new url. The fix is easy. if urlparts.fragment:

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread karl
karl added the comment: This is the correct behavior GET http://example.com/foo with a response containing 302 and Location: /bar#test must trigger http://example.com/bar#test Location is defined in http://tools.ietf.org/html/rfc7231#section-7.1.2 7.1.2. Location The Location

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread Shuhei Takahashi
Shuhei Takahashi added the comment: Hi karl, Of course it is correct that the user agent is redirected to http://example.com/bar#test when it got such response. However, it never means UA can send an HTTP request containing fragment part. In RFC7230 section 3.1.1, HTTP request line is

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread karl
karl added the comment: Takahashi-san, Ah sorry misunderstood which part your were talking about. I assume wrongly you were talking about navigation. Yes for the request which is sent to the server it should be http://tools.ietf.org/html/rfc7230#section-5.3.1 So refactoring your example.

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread karl
karl added the comment: In class urlopen_HttpTests https://hg.python.org/cpython/file/4f314dedb84f/Lib/test/test_urllib.py#l191 there is a test for invalid redirects def test_invalid_redirect(self): https://hg.python.org/cpython/file/4f314dedb84f/Lib/test/test_urllib.py#l247 And one for

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-03 Thread Mark Lawrence
Mark Lawrence added the comment: Slipped under the radar? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18119 ___ ___

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-08 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18119 ___ ___

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-04 Thread Mher Movsisyan
Changes by Mher Movsisyan mher.movsis...@gmail.com: -- nosy: +mher.movsisyan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18119 ___ ___

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-02 Thread Shuhei Takahashi
New submission from Shuhei Takahashi: When urllib.FancyURLopener encounters 302 redirection to a URL with fragments, it sends wrong URL to servers. For example, if we run: urllib.urlopen('http://example.com/foo') and the server responds like following. HTTP/1.1 302 Found Location: