Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > urlopen differences between python 2.3.3 and python 2.2???

Reply
Thread Tools

urlopen differences between python 2.3.3 and python 2.2???

 
 
Chris
Guest
Posts: n/a
 
      04-14-2004
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$g1V9TwRwtIEsBj5Xsn nN1/',
'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'hone,
'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 Removed)','First Name':'Chris','LastName':'Bruce'})
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DEVELOP THE WINNING EDGE, SMALL DIFFERENCES IN YOUR PERFORMANCE CANLEAD TO LARGE DIFFERENCES IN YOUR RESULTS Home_Job_opportunity C Programming 0 01-08-2009 04:31 PM
Re: difference between urllib2.urlopen and firefox view 'page source'? wesley chun Python 1 03-21-2007 03:16 PM
difference between urllib2.urlopen and firefox view 'page source'? cjl Python 5 03-20-2007 05:32 PM
urllib2.urlopen hangs, urllib.urlopen works? Chris Python 0 07-10-2005 06:40 PM
How to make URLLIB .urlopen(url1) .urlopen(url2) session related ? Xu, C.S. Python 5 09-17-2003 01:50 PM



Advertisments