Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParser converts option names to lower case on set() #43944

Closed
suslik mannequin opened this issue Sep 5, 2006 · 4 comments
Closed

ConfigParser converts option names to lower case on set() #43944

suslik mannequin opened this issue Sep 5, 2006 · 4 comments
Labels
extension-modules C modules in the Modules dir

Comments

@suslik
Copy link
Mannequin

suslik mannequin commented Sep 5, 2006

BPO 1552892
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2006-09-13.18:55:20.000>
created_at = <Date 2006-09-05.18:35:31.000>
labels = ['extension-modules', 'invalid']
title = 'ConfigParser converts option names to lower case on set()'
updated_at = <Date 2006-09-13.18:55:20.000>
user = 'https://bugs.python.org/suslik'

bugs.python.org fields:

activity = <Date 2006-09-13.18:55:20.000>
actor = 'suslik'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Extension Modules']
creation = <Date 2006-09-05.18:35:31.000>
creator = 'suslik'
dependencies = []
files = []
hgrepos = []
issue_num = 1552892
keywords = []
message_count = 4.0
messages = ['29770', '29771', '29772', '29773']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'suslik', 'mark-roberts']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1552892'
versions = ['Python 2.4']

@suslik
Copy link
Mannequin Author

suslik mannequin commented Sep 5, 2006

Python 2.4.2

Using set() in ConfigParser module converts all
characters in option names to lower case.

To reproduce:

>>> import ConfigParser
>>> cfg = ConfigParser.ConfigParser()
>>> cfg.add_section('SectioN')
>>> cfg.set('SectioN','OpTiOn","ValuE')
>>> cfg.items('SectioN')
[('option', 'ValuE')]

@suslik suslik mannequin closed this as completed Sep 5, 2006
@suslik suslik mannequin added invalid extension-modules C modules in the Modules dir labels Sep 5, 2006
@suslik suslik mannequin closed this as completed Sep 5, 2006
@suslik suslik mannequin added invalid extension-modules C modules in the Modules dir labels Sep 5, 2006
@mark-roberts
Copy link
Mannequin

mark-roberts mannequin commented Sep 6, 2006

Logged In: YES
user_id=1591633

I can reproduce this on Win XP, Python 2.4, however, it
doesn't seem to be a bug.

In the docs
(http://docs.python.org/lib/module-ConfigParser.html), it
states that
"All option names used in interpolation will be passed
through the optionxform() method just like any other option
name reference. For example, using the default
implementation of optionxform() (which converts option names
to lower case), the values "foo %(bar)s" and "foo %(BAR)s"
are equivalent."

You might consider subclassing if this is an inconvenience
for you.

@birkenfeld
Copy link
Member

Logged In: YES
user_id=849994

Mark is correct. This is not a bug.

@suslik
Copy link
Mannequin Author

suslik mannequin commented Sep 13, 2006

Logged In: YES
user_id=633916

Hmm, "broken" behavior by-design or not - it still makes it
impossible to use ConfigParser straight out in KDE, where
almost all option names are AaaaBbbbCccc.

I just went with a completely different parser.
http://wiki.python.org/moin/ConfigParserShootout

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

1 participant