SSL w/ urllib

Jp Calderone exarkun at flashmail.com
Sat Apr 22 12:49:04 EDT 2000


 I'm looking at these two lines of codes, trying to figure out how to
get the second one to work:

 f = urllib.urlopen('http://www.mudprovider.com/cgi-bin/printvars.cgi',
params)
 f = urllib.urlopen('https://www.mudprovider.com/cgi-bin/printvars.cgi',
params)

with params defined as:
 params = urllib.urlencode({'name': 'bob', 'value': 5})

The first works fine, and f.read() gives the expected output.  
The second gives me this, though:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python1.6/urllib.py", line 62, in urlopen
    return _urlopener.open(url, data)
  File "/usr/local/lib/python1.6/urllib.py", line 163, in open
    return getattr(self, name)(url, data)
TypeError: too many arguments; expected 2, got 3


 As far as I can tell, this is because of the 'https' instead of 'http'
My python interpreter is this:

  Python 1.6a2 (#7, Apr 17 2000, 11:50:39)  [GCC 2.95.2 19991024 (release)] on
linux2

 There are references to HTTPS in urllib, but nothing I can't tell what, if
anything, I should be doing differently to get https to work.  Can anyone
help me out?

  Thanks in advance, Jp

-- 
No, `Eureka' is Greek for `This bath is too hot.'
                -- Dr. Who
--
 4:44pm up 24 days, 21:51, 0 users, load average: 0.00, 0.02, 0.01



More information about the Python-list mailing list