[New-bugs-announce] [issue5741] SafeConfigParser incorrectly detects lone percent signs

Márcio Faustino <report@bugs.python.org> at psf.upfronthosting.co.za Márcio Faustino <report@bugs.python.org> at psf.upfronthosting.co.za
Sun Apr 12 14:35:10 CEST 2009


New submission from Márcio Faustino <m.faustino at gmail.com>:

The SafeConfigParser class incorrectly detects lone percent signs,
for example, it doesn't accept "100%%" as a valid value. The cause of 
this is the "_badpercent_re" regular expression:
- The first alternative "%[^%]" fails with the string "%%_", because it 
matches "%_".
- The second alternative "%$" fails with the string "%%", because it 
matches "%".

---

from ConfigParser import *
SafeConfigParser().set('DEFAULT', 'test', '100%%')

----------
components: Library (Lib)
messages: 85899
nosy: marcio
severity: normal
status: open
title: SafeConfigParser incorrectly detects lone percent signs
type: behavior
versions: Python 2.6

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


More information about the New-bugs-announce mailing list