STINNER Victor victor.stin...@haypocalc.com added the comment:
Thanks for your patch. ResourceWarning are really useful!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10883
___
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset c741ba9e37ef by Nadeem Vawda in branch '3.2':
Issue #10883: Fix socket leaks in urllib.request.
http://hg.python.org/cpython/rev/c741ba9e37ef
New changeset d68765bd6490 by Nadeem Vawda in branch 'default':
Merge:
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset dbf1e1a27427 by Nadeem Vawda in branch '2.7':
Issue #10883: Fix socket leaks in urllib.request.
http://hg.python.org/cpython/rev/dbf1e1a27427
--
___
Python tracker
Changes by Nadeem Vawda nadeem.va...@gmail.com:
--
resolution: accepted - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10883
Nadeem Vawda nadeem.va...@gmail.com added the comment:
Updated patch with fixed refcounting mechanism. Also fixes clear_cache() in
CacheFTPWrapper to leave the cache in a consistent state for subsequent use.
--
Added file: http://bugs.python.org/file22609/issue10883-v2.patch
Senthil Kumaran sent...@uthcode.com added the comment:
With the patch applied, test_urllib2net fails at test_ftp test case
when a valid and invalid url are presented in sequence. I think test
needs a change or a further look is needed at the patch.
--
Nadeem Vawda nadeem.va...@gmail.com added the comment:
The failure seems to occur sporadically. I'm looking into it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10883
___
Nadeem Vawda nadeem.va...@gmail.com added the comment:
The problem seems to be that CacheFTPHandler inherits ftp_open() from
FTPHandler - FTPHandler.ftp_open() marks the ftpwrapper object to be closed as
soon as the current transfer is complete. So CacheFTPHandler's cache ends up
full of closed
Changes by Nadeem Vawda nadeem.va...@gmail.com:
--
resolution: - accepted
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10883
___
Nadeem Vawda nadeem.va...@gmail.com added the comment:
Here's an updated patch implementing reference counting for ftpwrapper.
It changes the semantics of ftpwrapper.close() to postpone actually closing
the connection until all files have also been closed (like socket.close()).
--
Added
Roundup Robot devnull@devnull added the comment:
New changeset ca18f7f35c28 by Victor Stinner in branch '3.2':
Issue #10883: test_urllib2net closes socket explicitly
http://hg.python.org/cpython/rev/ca18f7f35c28
New changeset 6d38060f290c by Victor Stinner in branch 'default':
(Merge 3.2) Issue
STINNER Victor victor.stin...@haypocalc.com added the comment:
ftp_close.patch:
- (in passive mode) FTP.ntransfercmd() closes explicitly the socket on error:
the caller has not access to the socket on error
- OtherNetworkTests of test_urllib2net clears CacheFTPHandler cache: add a
STINNER Victor victor.stin...@haypocalc.com added the comment:
Is there still something to do in this issue? The initial report is fixed.
--
versions: -Python 2.6, Python 3.1
___
Python tracker rep...@bugs.python.org
Nadeem Vawda nadeem.va...@gmail.com added the comment:
Yes, the fix I provided only eliminated some of the warnings. As of
fd6446a88fe3, test_urllib2net still leaks 5 sockets.
--
___
Python tracker rep...@bugs.python.org
Roundup Robot devnull@devnull added the comment:
New changeset 2e5aff2a9e54 by Senthil Kumaran in branch '3.2':
issue10883 - Silence some ftp related ResourceWarnings in test_urllib2net.
Patch by Nadeem Vawda.
http://hg.python.org/cpython/rev/2e5aff2a9e54
New changeset 0937b3618b86 by Senthil
Nadeem Vawda nadeem.va...@gmail.com added the comment:
I saw the partial fix suggested by the patch, but for some reason I
did not see ResourceWarning being shutup.
Do you mean that you aren't getting ResourceWarnings in the first place?
Or that you are getting warnings, and the partial fix
Nadeem Vawda nadeem.va...@gmail.com added the comment:
Would it be possible to commit this partial fix now? It gets rid of 4 of the 8
warnings that I am currently seeing in test_urllib2net.
(As an aside, for anyone reading this who hasn't seen issue11563,
test_urllibnet is now warning-free)
Senthil Kumaran orsent...@gmail.com added the comment:
I saw the partial fix suggested by the patch, but for some reason I
did not see ResourceWarning being shutup. Let's look at this again.
The warnings are all from the (old) ftp portion of the code..
--
New submission from STINNER Victor victor.stin...@haypocalc.com:
test_urllibnet.py and test_urllibnet2.py emit ResourceWarning:
==
$ ./python Lib/test/test_urllibnet.py
testURLread (__main__.URLTimeoutTest) ... ok
test_bad_address (__main__.urlopenNetworkTests) ... ok
test_basic
19 matches
Mail list logo