urlopen differences between python 2.3.3 and python 2.2???

C

Chris

I am using the code below and it works correctly on python2.2 but
gives me a 404 not found error when running on python2.3.3. Is there
some difference? Maybe python 2.3.3 is sending different headers?

The params string looks to be encoded identically, so must be
something with urlopen. Does anyone have any suggestions to get this
working from python2.3.3??


Thanks in advance!

import httplib,urllib

def signup(self, REQUEST):
"""
Allows us to automatically sign-up a user.
"""
email = REQUEST['Email']
first_name = REQUEST['FirstName']
last_name = REQUEST['LastName']
if REQUEST.has_key('Company'):
company = REQUEST['Company']
else:
company = ''

if REQUEST.has_key('Address'):
address = REQUEST['Address']
else:
address = ''

if REQUEST.has_key('City'):
city = REQUEST['City']
else:
city = ''

if REQUEST.has_key('State'):
state = REQUEST['State']
else:
state = ''

if REQUEST.has_key('Zip'):
zip = REQUEST['Zip']
else:
zip = ''

if REQUEST.has_key('Phone'):
phone = REQUEST['Phone']
else:
phone = ''

if REQUEST.has_key('Fax'):
fax = REQUEST['Fax']
else:
fax = ''

params_list = {'owner_id_enc':'18164,$1$mGEJB$g1V9TwRwtIEsBj5XsnnN1/',
'user_email':email,
'user_email_fmt':'html',
'user_fname':first_name,
'user_lname':last_name,
'user_company':company,
'user_addr1':address,
'user_city':city,
'user_state':state,
'user_state_other':'',
'user_zip':zip,
'user_phone':phone,
'user_fax':fax,
'user_attr1':'a',
'function':'Subscribe'}
params = urllib.urlencode(params_list)
f = urllib.urlopen("http://mailermailer.com/x", params)
return f.read()

print signup(None,{'Email':'(e-mail address removed)','FirstName':'Chris','LastName':'Bruce'})
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top