Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Try to automatically fix files with mixed tabs #31

Closed
juanjux opened this issue Jun 29, 2017 · 3 comments
Closed

Try to automatically fix files with mixed tabs #31

juanjux opened this issue Jun 29, 2017 · 3 comments
Assignees
Labels

Comments

@juanjux
Copy link
Contributor

juanjux commented Jun 29, 2017

This is proving to be a common error causing the Python AST module not to parse the source file, but it should be easily fixable using the reindent.py script/module included with the Python standard distribution.

@abeaumont
Copy link
Contributor

Is the source code valid or invalid? If it's the former why does the AST module fail? If it's the latter I think it should fail, we shouldn't be correcting invalid code.

@juanjux
Copy link
Contributor Author

juanjux commented Jun 29, 2017

Is invalid in Python 2/3 and valid in Python 1 (Python2 produces a SyntaxError and Python3 a TabError). I don't know how people run that code actually if they're using a version of Python from the last decade.

AFAIK I got the impression from some early meetings that we should try to parse code with errors if we can get something out of it and in this case it would be easy; I don't know if that's still an objective.

In any case I was very tempted to mark this as feature but I would prefer to ear some opinions before doing that again.

@abeaumont
Copy link
Contributor

We have decided not to support Python 1. Handling this would be in the scope of the user

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants