Message227421
Ah! the User-Agent (or anything which is in unredirected_hdrs) will not be updated if it has already been set once.
https://hg.python.org/cpython/file/064f6baeb6bd/Lib/urllib/request.py#l1154
>>> headers = dict(request.unredirected_hdrs)
>>> headers
{'User-agent': 'Python-urllib/3.4', 'Host': '127.0.0.1'}
>>> request.headers
{'User-agent': 'Test-Agent', 'Foo': 'cool'}
>>> headers.update(dict((k, v) for k, v in request.headers.items() if k not in headers))
>>> headers
{'User-agent': 'Python-urllib/3.4', 'Host': '127.0.0.1', 'Foo': 'cool'} |
|
Date |
User |
Action |
Args |
2014-09-24 08:33:53 | karlcow | set | recipients:
+ karlcow |
2014-09-24 08:33:53 | karlcow | set | messageid: <1411547633.83.0.465406904057.issue22478@psf.upfronthosting.co.za> |
2014-09-24 08:33:53 | karlcow | link | issue22478 messages |
2014-09-24 08:33:53 | karlcow | create | |
|