[New-bugs-announce] [issue8894] urllib2 authentication manager retries forever if password is wrong
report at bugs.python.org
Fri Jun 4 09:10:28 CEST 2010
New submission from jurjen Bos <j.bos-interpay at xs4all.nl>:
If you use an authentication manager from urllib2, it will submit user code and password if authentication fails.
However, if the password is wrong, the authentication manager will happily try again, again with the same password.
A simple way to circumvent this is attached: it modifies the password manager's behaviour to submit each password only once.
One problem I see is in cases where a program needs to log in multiple times in the same site: I propose an extra call to the password manager to reset the "visited" flag.
More details and sample code are in the file.
components: Library (Lib)
title: urllib2 authentication manager retries forever if password is wrong
versions: Python 2.6
Added file: http://bugs.python.org/file17545/circumvent.py
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce