Message5442

Author amak
Recipients amak, julyzergcn
Date 2010-01-18.21:13:12
SpamBayes Score 5.551115e-16
Marked as misclassified No
Message-id <1263849196.09.0.123386048914.issue1542@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2010-01-18 21:13:16amaksetmessageid: <1263849196.09.0.123386048914.issue1542@psf.upfronthosting.co.za>
2010-01-18 21:13:16amaksetrecipients: + amak, julyzergcn
2010-01-18 21:13:15amaklinkissue1542 messages
2010-01-18 21:13:12amakcreate