google / google/yapf

Unicode variable names crash yapf

Open
#403 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

Minimal working example :
```python
def test(x):
Δ=x+2
print(Δ)

test(4)
```
this is legal python3, but yapf breaks and does nothing on a file with unicode variables. As can be seen here: the missing spaces in `Δ=x+2` were not added.

The error comes from lib2to3 (`lib2to3.pgen2.parse.ParseError: bad token: type=58, value='Δ', context=('', (2, 1))`) but I can not say if it is a bug in 2to3, or in yapf.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.