Martin Panter added the comment: Hmm, I wonder if that OpenerDirector example is a bit obscure. Normally you would use the default urlopen() to set User-Agent, without resorting to a custom OpenerDirector.
In my patch: * Included “User-Agent header _value_” in the “headers” parameter description * Linked to <https://docs.python.org/dev/howto/urllib2.html> from examples section * Added add_header("User-Agent", ...) example with made-up custom value Let me know what you think (if anything is unnecessary, other suggestions?) ---------- assignee: -> docs@python components: +Documentation -Library (Lib) keywords: +patch nosy: +docs@python stage: needs patch -> patch review type: behavior -> enhancement versions: +Python 2.7, Python 3.4, Python 3.6 Added file: http://bugs.python.org/file40984/add_header.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25570> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com