[Python-bugs-list] [ python-Bugs-476884 ] Configparser line continuations fail
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 31 Oct 2001 13:09:37 -0800
Bugs item #476884, was opened at 2001-10-31 10:56
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476884&group_id=5470
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Configparser line continuations fail
Initial Comment:
Configparser line continuations fail with a key error when the option is of mixed case. Configparser maps all options to lowercase (presumably for Win compatibility) but it does the mapping through a method call (optionxform) which leaves the option name (optname) untransformed. This causes a dictionary key error when continuation lines are encountered since the untransformed optname is used to build the continued line.
There are at least three possible fixes:
1. Make options case sensitive by eliminating
the optionxform method. (My workaround is to
overload the optionsxform method...)
2. Replace optname by it's lower case equivalent when it is constructed and use the lower case form throughout.
3. Insert calls to optionxform where the continuation lines are built. Messy and inefficient, IMHO.
For greatest generality, there ought to be parameters which manage case sensitivity for section names and option names.
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-31 13:09
Message:
Logged In: YES
user_id=6380
Assigned to Fred. Fred, didn't you dabble some in
ConfigParser? You might want to have a look at some of the
other open ConfigParser bugs too. Or you can pass this off
to someone who knows more about it.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476884&group_id=5470