Code - working in one system and not working in the other.

2008-01-01 Thread Amal
The following code works in a system with python 2.4.3 and does not work in
the system with python 2.4.2.

And both the systems directly connect to the internet.

import urllib2

url = http://www.abcd.com;
username = abcd
passowrd = efgh


password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_manager.add_password(None, url, username, passowrd)

authHandler = urllib2.HTTPBasicAuthHandler(password_manager)

opener = urllib2.build_opener(authHandler)

urllib2.install_opener(opener)

pagehandle = urllib2.urlopen(url)

s =  pagehandle.read()

print s

url = url+current/

pagehandle = urllib2.urlopen(url)

s =  pagehandle.read()
print s

url = url+20071128.zip

pagehandle = urllib2.urlopen(url)

fp = open(hello.zip, 'wb')
a = pagehandle.readline();
while a != :
fp.write(a)
a = pagehandle.readline();

#fp.write(pagehandle.read())
fp.close()

in the system it does not run, it gives a urllib2.HTTPError : HTTP Error
401: Authorization required ecception.
With the same user name and password the code runs in another system.


Amal.
-- 
http://mail.python.org/mailman/listinfo/python-list

HTML unit .

2007-12-19 Thread Amal
Is there something like HTML unit for python. I don't want to use jython and
use the existing Java based HTML unit.

Amal.
-- 
http://mail.python.org/mailman/listinfo/python-list

Html unit.

2007-10-01 Thread Amal
Is there something like HTML unit in Python ? For testing Web applications.

Amal.
-- 
http://mail.python.org/mailman/listinfo/python-list

ImportError: /usr/lib/python2.4/site-packages/_xmlplus/parsers/pyexpat.so: undefined symbol: PyUnicodeUCS4_Decode

2007-09-27 Thread Amal
When I am compiling some code, I am getting the following the above
mentioned error. So how can i go about solving this issue.

Should I recompile python using -enable-unicode=UCS4 option.  Is there no
other way to solve this issue.

Amal.
-- 
http://mail.python.org/mailman/listinfo/python-list