|
+ Search |
|
May 28th, 2001 00:29
Christopher Arndt, Mamoon Khan, ConfigParser.py
Dunno _why_ it behaves like this (maybe because windows, where this kind of configuration file is common, is a non-case-distinguishing system) but I it's in the source code, _how_ this is done: Look into <pythonlibdir>/ConfigParser.py. The culprit is in line 310 (Python 1.5.2) resp. line 468 (Python 2.1) in method _read(). Also affected is the method get() and maybe others too. In the version that comes with Python 2.1 you can change this behaviour on the fly: >>> import ConfigParser >>> p = ConfigParser.ConfigParser() >>> p.optionxform = lambda x: x >>> p.read('win.ini') >>> p.options('Windows Hilfe') ['H_WindowPosition', 'M_WindowPosition', 'C_WindowPosition']