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 Alecz, David Ford (FirefighterBlu3), martin.panter, moritzs, r.david.murray
Date 2016-01-01.08:22:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451636575.87.0.0293050749639.issue18543@psf.upfronthosting.co.za>
In-reply-to
Content
I closed Issue 18543 as a duplicate, which points out this also affects Python 2.7.9+, and can also be triggered by setting the “context” parameter.

Overall, I am not comfortable with the complication and hacks in the current patch. Maybe it would be simpler to not fix the bug, and just document that you cannot use the SSL context parameters with a custom opener. If necessary, we could add a new API to pass the context to the handler properly, as suggested by Benjamin in <https://bugs.python.org/issue23166#msg233484>, but that might have to be in 3.6+ only.

Some specific comments on the patch:

The url[:5] check should probably check for a colon as well.

What’s the problem with multiple HTTPS handlers? Is it a side effect of your patch, or did it already exist? Is it only a problem for urlopen(), or also for calling open() directly?

You can use any() instead of building a list and testing if it is empty.

I think you can handle https: URLs without defining https_open(), for instance I have a handler that defines default_open() and checks the request manually. Does your patch account for that?

The patch seems to modify the default installed opener with the supplied SSL parameters. Also I wonder if it would break any multithreaded usage that currently works.

It would be good to have test cases integrated into the existing suite.
History
Date User Action Args
2016-01-01 08:22:55martin.pantersetrecipients: + martin.panter, r.david.murray, moritzs, Alecz, David Ford (FirefighterBlu3)
2016-01-01 08:22:55martin.pantersetmessageid: <1451636575.87.0.0293050749639.issue18543@psf.upfronthosting.co.za>
2016-01-01 08:22:55martin.panterlinkissue18543 messages
2016-01-01 08:22:54martin.pantercreate