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: 
www.koreapas.com\r\nAccept-Encoding: identity\r\nContent-Length: 
31\r\nUser-Agent: Mozilla/5.0 (Linux; Android 4.2.2; GT-I9505 Build/JDQ39) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile 
Safari/537.36\r\nContent-Type: 
application/x-www-form-urlencoded\r\n\r\nuser_id=blahsdfi&password=qwera'
reply: 'HTTP/1.1 200 OK\r\n'
b'Date: Tue, 03 Nov 2015 11:23:16 GMT\r\n'
b'Server: Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8e-fips-rhel5 DAV/2 
PHP/5.2.16 mod_fastcgi/2.4.6\r\n'
b'X-Powered-By: PHP/5.2.16\r\n'
b'P3P: CP="NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM 
PRE"\r\n'
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'
b'Set-Cookie: PHPSESSID=e990184309013a2c97579c76a52e203a; path=/\r\n'
b'Content-Length: 1504\r\n'
b'Connection: close\r\n'
b'Content-Type: text/html\r\n'
b'\r\n'
########################## hstring
Date: Tue, 03 Nov 2015 11:23:16 GMT
Server: Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8e-fips-rhel5 DAV/2 
PHP/5.2.16 mod_fastcgi/2.4.6
X-Powered-By: PHP/5.2.16
P3P: CP="NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM 
PRE"
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"
Set-Cookie: PHPSESSID=e990184309013a2c97579c76a52e203a; path=/
Content-Length: 1504
Connection: close
Content-Type: text/html


######################################
########################### parsed
b'Date: Tue, 03 Nov 2015 11:23:16 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 PRE"\n\nP3P : 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"\nSet-Cookie: PHPSESSID=e990184309013a2c97579c76a52e203a; 
path=/\nContent-Length: 1504\nConnection: close\nContent-Type: text/html\n\n'
#######################################

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25539>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to