f



urlopen differences between python 2.3.3 and python 2.2???

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':'test7@chongopunk.com','FirstName':'Chris','LastName':'Bruce'})
0
4/14/2004 6:46:04 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

0 Replies
1010 Views

Similar Articles

[PageSpeed] 21

Reply: