d = {
"ó": {
"á": {
"í": {
"theta": 1
}
}
}
}
try:
result = d["ó"]["á"]["í"]["beta"]
except:
import traceback;traceback.print_exc()
Traceback (most recent call last):
File "W:\pydev.debugger\check\snippet2.py", line 12, in <module>
result = d["ó"]["á"]["í"]["beta"]
~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'beta'
Notice that for each additional unicode char, an additional `~' is added.
Bug report
Consider the code below:
The output provided is:
Notice that for each additional unicode char, an additional `~' is added.
This seems to happen because when computing the anchors in
traceback._extract_caret_anchors_from_line_segmentthe columns from the ast nodes generated inast.parseseem to be related to bytes and not actual chars.Your environment