urllib en https

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cecil Westerhof

    #1

    urllib en https

    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_unkno wn(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?

  • sp1d3rx@gmail.com

    #2
    Re: urllib en https

    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.

    Cecil Westerhof wrote:
    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_unkno wn(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?

    Comment

    • Cecil Westerhof

      #3
      Re: urllib en https

      Cecil Westerhof wrote:
      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_unkno wn(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.

      Comment

      • John J. Lee

        #4
        Re: urllib en https

        Dennis Lee Bieber <wlfraed@ix.net com.comwrites:
        On Wed, 13 Sep 2006 23:03:08 +0200, Cecil Westerhof <dummy@dummy.nl >
        declaimed the following in comp.lang.pytho n:
        >

        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.
        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

        Comment

        • John J. Lee

          #5
          Re: urllib en https

          jjl@pobox.com (John J. Lee) writes:
          [...]
          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

          Comment

          • Podi

            #6
            Re: urllib en https

            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.
            >
            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

            Comment

            Working...