Message5442
I'm sorry, but I don't understand this bug report.
> urllib.urlretrieve cannot close connection automatically.
> also, urllib.urlopen cannot close.
> e.g.
> if I want to download a file from a ftp server, write one line like this,
> import urllib
> urllib.urlretrieve('ftp://user:pass@hostname/fdir', 'localname')
> after the file is download, the connection cannot close automatically, but Python2.5 can.
When I run the above code on Windows, both cpython and jython keep the socket connection open.
> also, the following code can not close the connection as well.
> import urllib
> f = urllib(''ftp://user:pass@hostname/fdir')
> print f.read()
> f.close()
This could has syntax errors, and tries to call to call the urllib module directly, rather than a function in the module, which breaks with "Module not callable".
Please can you post a running example, which illustrates the behaviour you expect to see? Use a public FTP URL that doesn't need login credentials.
> would it be possible to make Jython close the connection like Python?
> thanks
Are you relying on cpython's garbage collection, which is different to jython's, to close the socket for you, perhaps?
http://mail.python.org/pipermail/python-dev/2008-May/079218.html |
|
Date |
User |
Action |
Args |
2010-01-18 21:13:16 | amak | set | messageid: <1263849196.09.0.123386048914.issue1542@psf.upfronthosting.co.za> |
2010-01-18 21:13:16 | amak | set | recipients:
+ amak, julyzergcn |
2010-01-18 21:13:15 | amak | link | issue1542 messages |
2010-01-18 21:13:12 | amak | create | |
|