[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: https://mail

[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: urlpart

[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 fragme

[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. 1st

[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 defined

[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" h

[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 ___ ___ Python-bugs-list mailing li

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

2013-06-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

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

2013-06-04 Thread Mher Movsisyan
Changes by Mher Movsisyan : -- nosy: +mher.movsisyan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[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: /bar#te