urllib en https

C

Cecil Westerhof

Something went wrong with my last post. So, again:

I have a strange problem. I wrote a script that uses urllib.urlopen to fetch
a page through https. In Python 2.2.2 this works without a problem. But
when I use the script in Python 2.4.1 (which is more recent) I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.4/urllib.py", line 79, in urlopen
    return opener.open(url, data)
  File "/usr/local/lib/python2.4/urllib.py", line 177, in open
    return self.open_unknown(fullurl, data)
  File "/usr/local/lib/python2.4/urllib.py", line 189, in open_unknown
    raise IOError, ('url error', 'unknown url type', type)
IOError: [Errno url error] unknown url type: 'https'

What is happening here? And how can I solve this?
 
S

sp1d3rx

please provide a sample program, which has the minimal functionality
necessary to reproduce this error. I've checked and the syntax hasn't
changed. Perhaps it's with the string you are passing as "fullurl".
Anyways, I can't really troubleshoot more than that without some code.
 
C

Cecil Westerhof

Cecil said:
Something went wrong with my last post. So, again:

I have a strange problem. I wrote a script that uses urllib.urlopen to
fetch a page through https. In Python 2.2.2 this works without a problem.
But when I use the script in Python 2.4.1 (which is more recent) I get:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.4/urllib.py", line 79, in urlopen
return opener.open(url, data)
File "/usr/local/lib/python2.4/urllib.py", line 177, in open
return self.open_unknown(fullurl, data)
File "/usr/local/lib/python2.4/urllib.py", line 189, in open_unknown
raise IOError, ('url error', 'unknown url type', type)
IOError: [Errno url error] unknown url type: 'https'

I found the problem. The first Python was compiled with ssl support enabled
and the second without ssl support enabled.
 
D

Dennis Lee Bieber

I found the problem. The first Python was compiled with ssl support enabled
and the second without ssl support enabled.

A vision is forming in the crystal ball... I see... ActiveState...

As I recall, ActiveState doesn't distribute the SSL package that the
python.org package contains. But... It is possible to copy the SSL
related files from a python.org package into the ActiveState
installation.
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
J

John J. Lee

Dennis Lee Bieber said:
A vision is forming in the crystal ball... I see... ActiveState...

As I recall, ActiveState doesn't distribute the SSL package that the
python.org package contains. But... It is possible to copy the SSL
related files from a python.org package into the ActiveState
installation.

Does ActiveState do a unix distribution of Python now?

(The OP seemed to have a Unix-like system -- so probably he didn't
install have the right rpm or whatever installed -- a very common
problem with people trying to use SSL on linux distributions.)


John
 
J

John J. Lee

Does ActiveState do a unix distribution of Python now?

(The OP seemed to have a Unix-like system -- so probably he didn't
install have the right rpm or whatever installed -- a very common
problem with people trying to use SSL on linux distributions.)


John

Hmm, so they do (maybe they always did?):

| ActivePython is ActiveState's quality-assured, ready-to-install
| distribution of Python, available for AIX, HP-UX, Linux, Mac OS X,
| Solaris, and Windows. The standard ActivePython distribution is
| available for free download.


Still, I suspect a missing system package is a more likely culprit.


John
 
P

Podi

Are there any instructions on doing this? My Python installation from
cygwin seems to have SSL but not the ActiveState. However, I really
like the ActiveState PythonWin UI.

I would be much appreciated if anyone can provide pointer to get the
SSL in AS Python to work.

Thanks in advance.
P
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,201
Latest member
KourtneyBe

Latest Threads

Top