[New-bugs-announce] [issue8894] urllib2 authentication manager retries forever if password is wrong

jurjen Bos 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)
files: circumvent.py
messages: 107009
nosy: Jurjen
priority: normal
severity: normal
status: open
title: urllib2 authentication manager retries forever if password is wrong
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file17545/circumvent.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8894>
_______________________________________


More information about the New-bugs-announce mailing list