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 loewis
Recipients eric.araujo, loewis, pitrou
Date 2010-11-21.20:19:26
SpamBayes Score 0.0006975444
Marked as misclassified No
Message-id <1290370769.94.0.0170577513111.issue10441@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch that changes SSLContext into a context manager, allowing to write code like

    with ssl.SSLContext(ssl.PROTOCOL_SSLv23):
        ssl.SSLContext.current().set_default_verify_path()
        res = urllib.request.urlopen("https://www.microsoft.com")

If people like this approach, feel free to adjust it; I likely won't have much time to work on it further.
History
Date User Action Args
2010-11-21 20:19:30loewissetrecipients: + loewis, pitrou, eric.araujo
2010-11-21 20:19:29loewissetmessageid: <1290370769.94.0.0170577513111.issue10441@psf.upfronthosting.co.za>
2010-11-21 20:19:26loewislinkissue10441 messages
2010-11-21 20:19:26loewiscreate