473,385 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Restoring override of urllib.URLopener.open_https

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

Oct 5 '06 #1
2 1479
I think that you need a superclass above the M2Crypto one, and change
the open_https method back to the urllibs one.

Moi
Dolf

On Thu, 5 Oct 2006 15:09:22 GMT, Bakker A <ar**@cs.vu.nlwrote:
>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
Oct 5 '06 #2
In article <16********************************@4ax.com>,
goyatlah <seresta At wanadoo Dot nlwrote:
>
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

Oct 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gary Feldman | last post by:
I think I've found a deficiency in the design of urllib related to https. In order to complete an https connection, it appears that URLOpener and hence FancyURLOpener require the key and cert...
4
by: Richard Shea | last post by:
Hi - I'm new to Python. I've been trying to use URLLIB and the 'tidy' function (part of the mx.tidy package). There's one thing I'm having real difficulties understanding. When I did this ... ...
7
by: Fuzzyman | last post by:
I'm writing a function that will query the comp.lang.python newsgroup via google groups....... (I haven't got nntp access from work..) I'm using urllib (for the first time)..... and google don't...
3
by: Haim Ashkenazi | last post by:
Hi I'm writing a script that uses urllib on win98. until now I used python 2.3.x (x < 4) and it worked ok. I re-installed windows and installed python 2.3.4 and now I get an error when trying to...
1
by: John Nagle | last post by:
If you try to open a password protected page with "urllib.urlopen()", you get "Enter username for EnterPassword at example.com:" on standard output, followed by a read for input! This seems to...
4
by: John Nagle | last post by:
There's no way to set a timeout if you use "urllib" to open a URL. "HTTP", which "urllib" uses, supports this, but the functionality is lost at the "urllib" level. It's not available via "class...
5
by: Adrian Smith | last post by:
I'm trying to use urllib2 to download a page (I'd rather use urllib, but I need to change the User-Agent header to look like a browser or G**gle won't send it to me, the big meanies). The following...
4
by: Fernando Rodriguez | last post by:
Hi, I'musing urllib to download pages from a site. How can I detect if a given url is being redirected somewhere else? I want to avoid this, is it possible? Thanks in advance!
4
by: tstrogen | last post by:
I am using Python 2.6 on Mac OS 10.3.9. I have been trying to use: image = urllib.URLopener() image.retrieve(url, filename) to download images from websites. I am able to do so, and end up with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.