brython-dev / brython

Brython (Browser Python) is an implementation of Python 3 running in the browser
BSD 3-Clause "New" or "Revised" License
6.37k stars 509 forks source link

Problem when using keys with the ' character in dict #2200

Closed jibalamy closed 1 year ago

jibalamy commented 1 year ago

Hello,

I encounter problem when using keys with the ' character in dict.

Here is an example (tested today in the Bython console online):

d = {"Corriger les erreurs d'extraction" : 1} d[list(d.keys())[0]] Traceback (most recent call last): File "", line 1, in KeyError: Corriger les erreurs d'extraction

Notice that the problem disappear if the ' character is removed.

Thank you for providing Brython! Jiba

PierreQuentel commented 1 year ago

Thanks for the report @jibalamy !

The problem was not visible in the latest development version because of a change in the implementation of dictionary, but the initial cause of the bug was still there. The commit referenced above fixes it.