running a Python script against a Windows (IIS) webserver kept giving me a 500 error, even though wget fetched the page just fine. by process of elimination, found out that urllib2's Accept-Encoding header value of 'identity' was causing Bill to flip out. changed it to '' (empty string) using opener.add_headers(), and forcing use of my new value using uppercase on the key (see http://vsbabu.org/mt/archives/2003/05/27/urllib2_setting_http_headers.html), and now it gets to first base at least. not even going to mention how many hours that held me back.
Back to blog or home page
last updated 2013-08-23 18:32:52. served from tektonic