Restoring override of urllib.URLopener.open_https

B

Bakker A

Hi,

the M2Crypto library overrides the urllib.URLopener.open_https method,
causing a urllib.urlopen to a https: server to fail in my
case. My python is not that strong, so is there a way to set
urllib.URLopener.open_https back to the original code? I prefer not to
modify M2Crypto.

Thanks,
Arno Bakker
 
G

goyatlah

I think that you need a superclass above the M2Crypto one, and change
the open_https method back to the urllibs one.

Moi
Dolf
 
B

Bakker A

I think that you need a superclass above the M2Crypto one, and change
the open_https method back to the urllibs one.

I'm not sure I get your suggestion. What the M2Crypto module does is:

import m2urllib

in its __init__.py, which blatantly does

from urllib import *
URLopener.open_https = open_https

in turn, so there's no subclassing going on, and AFAIK, the original urllib
code is irreversibly overwritten. Am I right?

Thanks,
Arno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top