A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-April/134301.html below:

[Python-Dev] ConfigParser mangles keys with special chars

[Python-Dev] ConfigParser mangles keys with special chars [Python-Dev] ConfigParser mangles keys with special charsFred Drake fred at fdrake.net
Fri Apr 25 21:58:26 CEST 2014
On Fri, Apr 25, 2014 at 3:12 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Perhaps an enhancement request then:  a way to provide a regex that keys
> must match, with an exception raised when a key doesn't.  That way the
> safety belt could be used when desired.

You can subclass the parser class you're using and override the
``optionxform`` method to perform the checks you want for option
names.  I don't know if current versions provide a similar hook to
validate section names; providing *that* would be an excellent
enhancement.


  -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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4