tonybaloney / Pyjion

Pyjion - A JIT for Python based upon CoreCLR
https://www.trypyjion.com
MIT License
1.42k stars 59 forks source link

bug with configparser case sensitive #493

Open vincentpichon opened 2 years ago

vincentpichon commented 2 years ago

Hi, I have a problem reading a case sensitive file with ConfigParser and pyjion.

Example :

python version : 3.10.4 pyjion version : 1.2.6

# !/usr/bin/python3
# -*- coding: utf-8 -*

import configparser

CONF_FILE = """
[TeST]
caseSensitive=TesT
"""

cfg = configparser.ConfigParser(allow_no_value=True, delimiters=("=",))
cfg.optionxform = str
cfg.read_string(CONF_FILE)

print(f'Without pyjion : sec list : {cfg.sections()} : sec options {dict(cfg["TeST"])}')

import pyjion
pyjion.enable()

cfg = configparser.ConfigParser(allow_no_value=True, delimiters=("=",))
cfg.optionxform = str
cfg.read_string(CONF_FILE)

print(f'With pyjion: sec list : {cfg.sections()} : sec options {dict(cfg["TeST"])}')

output :

# python3.10 config_test.py 
Without pyjion : sec list : ['TeST'] : sec options {'caseSensitive': 'TesT'}
With pyjion: sec list : ['TeST'] : sec options {'casesensitive': 'TesT'}

Sections and values are case sensitive but not options. Anyone having the same issue ?