[Pythonmac-SIG] Problems with urllib?

Yair Benita Y.Benita@pharm.uu.nl
Mon, 21 Jan 2002 18:15:34 +0100


I try to run a simple query using urllib. For example:

import urllib

x=urllib.urlopen("http://www.ebi.ac.uk/cgi-bin/emblfetch?db=embl&format=fast
a&style=raw&id=AB002378")
print x.read()

It looks like macpython is trying to read x before it is finished loading,
resulting in incomplete files. When I run it step by step in the debugger it
works perfectly.
Is there something different in the mac urllib which I should know?
The mac documentation refers to a mactcp module but I could not find it in
my installation (python 2.2). Maybe I need to put a command so that the
program waits until the communication is done.

Can anyone give some solution to this?

Thanks
Yair
-- 
Yair Benita
Pharmaceutical Proteomics
Faculty of Pharmacy
Utrecht University
The Netherlands
Tel: +31 30 2539340
Fax: +31-30-2534662
E-mail: Y.Benita@pharm.uu.nl