[Python-bugs-list] [ python-Bugs-476884 ] Configparser line continuations fail

noreply@sourceforge.net noreply@sourceforge.net
Wed, 31 Oct 2001 10:56:45 -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: Nobody/Anonymous (nobody)
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.















----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476884&group_id=5470