This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_urllib2_localnet DigestAuthHandler leaks nonces
Type: behavior Stage: patch review
Components: Tests Versions: Python 3.0, Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: collinwinter Nosy List: collinwinter, orsenthil, r.david.murray
Priority: low Keywords: easy

Created on 2009-05-11 22:33 by r.david.murray, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg87593 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-05-11 22:33
I tracked down the exact cause of the refleak in test_urllib2_localnet.
 Turns out the DigestAuthHandler adds a nonce to its internal _nonces
list every time _return_auth_challenge is called, but not all of these
nonces are removed from the list.

Not sure what the cleanest fix would be.  I'm not that familiar with
auth protocols; I'm guessing a real auth server would time out stale
nonces.  One question I have is if the tests are expecting that the
nonce will get deleted, and thus there is a real bug here...but I
suspect not.

Adding

   FakeProxyHandler.digest_auth_handler._nonces = []

to the tearDown for ProxyAuthTests fixes the leak.  Is this acceptable,
or does this merit further investigation?
msg88052 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-05-18 20:40
I've posted a patch in issue 6032 (didn't see this one); I'd be
interested in any comments on the approach taken there.
msg88056 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-05-18 22:34
Daniel Diniz reviewed in the other issue.

Fixed in r72777 (trunk), r72778 (py3k).
History
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50252
2009-05-18 22:34:17collinwintersetstatus: open -> closed
assignee: collinwinter
resolution: fixed
messages: + msg88056
2009-05-18 20:40:41collinwintersetnosy: + collinwinter
messages: + msg88052
2009-05-17 08:21:59orsenthilsetnosy: + orsenthil
2009-05-16 01:07:56ajaksu2linkissue6032 dependencies
2009-05-11 22:35:31r.david.murraysettitle: test_urlllib2_localnet DigestAuthHandler leaks nonces -> test_urllib2_localnet DigestAuthHandler leaks nonces
2009-05-11 22:35:19r.david.murraylinkissue5596 dependencies
2009-05-11 22:33:52r.david.murraycreate