You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem in NameMapper, the central component of Cheetah. When it interprets $match.group(2) it first tries match['group'] and if got TypeError exception it continues with attribute access getattr(match, 'group'). Unfortunately MatchObject implements both attribute and index access, and match['group'] raises IndexError instead of TypeError because it's possible to do match[2] instead of match.group(2). Recently Python 3.13 started to catch more exceptions and that's where NameMapper fails. I'll think how to work around the problem.
Meanwhile you can change your template(s) to use match[2], that works; NameMapper doesn't map index access to attribute access, match[2] always means exactly that.
The following code results in the new python 3.13.0rc2 in an error, it works fine in all previous major python versions.
results in error:
IndexError: no such group
The text was updated successfully, but these errors were encountered: