This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ConfigParser has_option case sensitive
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, knet
Priority: normal Keywords:

Created on 2002-05-29 07:01 by knet, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ConfigParser.patch knet, 2002-05-29 07:01 Patch for python 2.2's ConfigParser.py
Messages (2)
msg10948 - (view) Author: David Taylor (knet) Date: 2002-05-29 07:01
In python 2.x ConfigParser.py has_option has the
following case-sensitive code:

	if not section or section == "DEFAULT":
		return self.__defaults.has_key(option)

whereas the rest of the module uses option.lower(). 
This means the DEFAULT section is case-sensitive but
other sections are not.

Attached is a patch to fix the problem in Python 2.2.
msg10949 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2002-09-27 15:35
Logged In: YES 
user_id=3066

Fixed in Lib/ConfigParser.py 1.38.10.2 + 1.38.10.3 and 1.45.
 Added regression test in Lib/test/test_cfgparser.py
1.9.10.2 and 1.13.
History
Date User Action Args
2022-04-10 16:05:21adminsetgithub: 36658
2002-05-29 07:01:40knetcreate