Martin Panter added the comment: I suspect for Demian’s 2.7 experiment, he used the older urllib.urlopen(), rather than urllib2.urlopen() as given in the original description. When I use urllib2.urlopen("http://localhost/"), I see
GET / HTTP/1.1 Accept-Encoding: identity Host: localhost Connection: close User-Agent: Python-urllib/2.7 Even in the urllib (no 2) case, since it is using HTTP 1.0, I suspect not having Accept-Encoding is not such a problem. The underlying HTTP library has always added “Accept-Encoding: identity” for HTTP 1.1 by default (https://hg.python.org/cpython/annotate/4a3e9871b41b/Lib/httplib.py#l444), so I am closing this. ---------- nosy: +martin.panter resolution: -> works for me status: pending -> closed title: Should urrllib2.urlopen send an Accept-Encoding header? -> Should urllib2.urlopen send an Accept-Encoding header? _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8732> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com