[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#test
Then urllib tries next to fetch http://example.com/bar#test, instead of 
http://example.com/bar.

Correctly, urllib should strip fragment part of URL before issuing requests.

--
components: Library (Lib)
messages: 190480
nosy: takahashi.shuhei
priority: normal
severity: normal
status: open
title: urllib.FancyURLopener does not treat URL fragments correctly
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue18119>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 as:
request-line   = method SP request-target SP HTTP-version CRLF
where request-target is defined in section 5.3. In usual case, it is 
origin-form:
origin-form= absolute-path [ "?" query ]
which never includes fragment part.

This means current urllib behavior violates HTTP/1.1 spec.

--

___
Python tracker 
<http://bugs.python.org/issue18119>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com