[Python-Dev] ConfigParser mangles keys with special chars

Fred Drake fred at fdrake.net
Fri Apr 25 20:54:56 CEST 2014


On Fri, Apr 25, 2014 at 2:45 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> I leave it to someone to carefully read the doc, but a brief glance
> indicates "There are nearly as many INI format variants as there are
> applications using it. configparser goes a long way to provide support for
> the largest sensible set of INI styles available." So I wonder whether the
> thought-to-be-buggy behavior is actually buggy with respect to *all* the
> supported styles or just some of them.

Given that most variants are completely undocumented, answering this
is sufficiently intractable for me to call it intractable.

We've also run into compatibility issues because some applications
treated the "parser" object as an in-memory configuration database
throughout the process lifetime, updating values with non-string
values of various sorts.  Given the age of the module, the existing
number of uses of undocumented accidents of implementation is very
large.  Fixing "bugs" like this has an excellent track record of
uncovering these uses, so... we've grown a bit wary.  It's not unheard
of for projects to fork their own copies of configparser because of
changes to the stdlib version.  (No, I haven't done a census of such
cases, but I do know of at least one in a popular package.)


  -Fred

-- 
Fred L. Drake, Jr.    <fred at fdrake.net>
"A storm broke loose in my mind."  --Albert Einstein


More information about the Python-Dev mailing list