[issue25539] python3 fail on parsing http header

2015-11-04 Thread R. David Murray
R. David Murray added the comment: Support for handling such headers could be added to the new email API (ie: add a policy setting to accept them), if someone wants to make a feature request. -- nosy: +r.david.murray ___ Python tracker

[issue25539] python3 fail on parsing http header

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Just noticed the whitespace scenario is mentioned at : ''' No whitespace is allowed between the header field-name and colon. In the past, differences in the handling of such whitespace have led to security

[issue25539] python3 fail on parsing http header

2015-11-04 Thread Shin Dong-won
Shin Dong-won added the comment: Yeah, this is server's fault and python does not have to deal with non-standard cases. I'll close this issue. Thanks! -- status: open -> closed ___ Python tracker

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Martin Panter
Martin Panter added the comment: Are you able to print out the repr() of the header or the entire HTTP response so we can see exactly what characters are there? Or provide a URL if it is a public server. I suspect it may not be a completely blank line, but may have whitespace there. Both

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Martin Panter
Changes by Martin Panter : -- type: crash -> behavior ___ Python tracker ___ ___

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Shin Dong-won
Shin Dong-won added the comment: I had a mistake. That's not CRLF but just two '\n'. -- ___ Python tracker ___

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Shin Dong-won
Shin Dong-won added the comment: I found that Python3 no more uses header format from rfc822, and the data b'P3P : CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"\r\n' not match with `headerRE = re.compile(r'^(From

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Shin Dong-won
Shin Dong-won added the comment: b'Date: Tue, 03 Nov 2015 10:05:42 GMT\nServer: Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8e-fips-rhel5 DAV/2\n PHP/5.2.16 mod_fastcgi/2.4.6\nX-Powered-By: PHP/5.2.16\nP3P: CP="NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM\n

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Martin Panter
Martin Panter added the comment: Okay, now I understand the problem. There is a quirky header line with a space in the field name “P3P ”. The HTTP client’s parse_headers() treats this as any other header line, but then it passes the header to the email package, which interprets this line as

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Shin Dong-won
Shin Dong-won added the comment: I think so but same http request works well in Python2 -- ___ Python tracker ___

[issue25539] python3 fail on parsing http header

2015-11-03 Thread STINNER Victor
STINNER Victor added the comment: > It contains two line of continuous CRLF between the data. It looks like a bug at server side. \n\n is the separator between headers and data. An header must not end with \n\n. -- nosy: +haypo ___ Python tracker

[issue25539] python3 fail on parsing http header

2015-11-03 Thread Shin Dong-won
Shin Dong-won added the comment: I monkey patched the method `parse_headers` to print what the fp read and finally arrived at that http.client is not a problem. email.parser.Parser.parsestr adds two '\n' between two lines of "P3P: ~~". end: b'POST /bbs/login_check.php HTTP/1.1\r\nHost:

[issue25539] python3 fail on parsing http header

2015-11-02 Thread 신동원
New submission from 신동원: I tried to login some website using requests session, but it failed because of parsing header. This is header data of problem. It contains two line of continuous CRLF between the data. Date: Mon, 02 Nov 2015 08:45:48 GMT Server: Apache/2.2.20 (Unix) mod_ssl/2.2.20