Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native parser crash: Mix of spaces and tabs #829

Open
tushar-deepsource opened this issue Dec 2, 2022 · 0 comments
Open

Native parser crash: Mix of spaces and tabs #829

tushar-deepsource opened this issue Dec 2, 2022 · 0 comments
Labels
bug Something isn't working parsing Converting source code into CST nodes

Comments

@tushar-deepsource
Copy link

The parser seems to crash on even the most trivial mixing of tabs and spaces:

def foo(x):
	 with x:
		 pass

The indentation is: 1 tab and 1 space, followed by 2 tabs and 1 space

The error:

>>> import libcst
>>> libcst.parse_module('''\
... def foo(x):
...      with x:
...              pass
... ''')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/libcst/_parser/entrypoints.py", line 109, in parse_module
    result = _parse(
@Zac-HD Zac-HD mentioned this issue Apr 29, 2023
@zsol zsol added bug Something isn't working parsing Converting source code into CST nodes labels May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parsing Converting source code into CST nodes
Projects
None yet
Development

No branches or pull requests

2 participants