This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Denis Savenko, docs@python, martin.panter
Date 2015-12-12.03:21:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449890518.58.0.862120916585.issue25841@psf.upfronthosting.co.za>
In-reply-to
Content
Assuming you meant http://www.python.org/ (added the www), I cannot produce any error with any example that requests directly to the site. The “http:” server already redirects to “https:”, so there is no problem. Obviously the examples that depend on made-up servers like proxy.example.com are going to fail.

In particular, the second FancyURLopener example works for me. Modified slightly to avoid copious output:

$ python3.5 -bWall
Python 3.5.0 (default, Sep 20 2015, 11:28:25) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> opener = urllib.request.FancyURLopener({})
__main__:1: DeprecationWarning: FancyURLopener style of invoking requests is deprecated. Use newer urlopen functions/methods
>>> with opener.open("http://www.python.org/") as f:
...     response = f.read().decode('utf-8')
... 
>>> response[:100]
'<!doctype html>\n<!--[if lt IE 7]>   <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9">   <![endif]-->\n<!-'

Please try this in the plain Python interpreter rather than I-Python, or be more specific about what you are trying to do and what the result is.

BTW I dunno what the FancyUrlopener example is doing there. In the Python 3 documentation, FancyURLopener is not introduced until the “Legacy interface” section later on. Perhaps the example should be moved.
History
Date User Action Args
2015-12-12 03:21:58martin.pantersetrecipients: + martin.panter, docs@python, Denis Savenko
2015-12-12 03:21:58martin.pantersetmessageid: <1449890518.58.0.862120916585.issue25841@psf.upfronthosting.co.za>
2015-12-12 03:21:58martin.panterlinkissue25841 messages
2015-12-12 03:21:57martin.pantercreate