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

TabError: inconsistent use of tabs and spaces in indentation #2

Closed
cclauss opened this issue Aug 14, 2018 · 6 comments
Closed

TabError: inconsistent use of tabs and spaces in indentation #2

cclauss opened this issue Aug 14, 2018 · 6 comments

Comments

@cclauss
Copy link

cclauss commented Aug 14, 2018

Python 3 treats TabErrors as syntax errors

flake8 testing of https://github.com/joukos/PaperTTY on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./papertty.py:312:20: E999 TabError: inconsistent use of tabs and spaces in indentation
	    if not noclear:
                   ^
1     E999 TabError: inconsistent use of tabs and spaces in indentation
1
@joukos
Copy link
Owner

joukos commented Aug 14, 2018

Thanks, fixed in 502fffd , was due to sloppiness with editing ;)

The code is for Python 2 though, but consistency is good.

@joukos joukos closed this as completed Aug 14, 2018
@cclauss
Copy link
Author

cclauss commented Aug 14, 2018

500 days until Python 2 end of life...

@joukos
Copy link
Owner

joukos commented Aug 15, 2018

Reason for Python 2 is mentioned in README.md - I would prefer Python 3.

@cclauss
Copy link
Author

cclauss commented Aug 15, 2018

The PIL library that sudo apt-get install python-imaging is installing has not been update in almost 10 years. http://www.pythonware.com/products/pil/ and Pillow is the Python community's supported replacement.

http://pillow.readthedocs.io -- python-imaging should be uninstalled before installing Pillow.

You might be able to run on either Python 2 or Python 3 by replacing the line:

Another route would be to replace sudo apt-get install python-imaging python click with:

  • sudo apt-get remove python-imaging
  • sudo apt-get install python-pil python click

@joukos
Copy link
Owner

joukos commented Aug 15, 2018

The Waveshare library uses python-imaging - I didn't want to make changes to their code (others have already done that). Feel free to fork/PR with your changes so it's modern, Python 3 compatible and still works hassle-free on Raspbian Stretch. (and perhaps create another issue)

@joukos
Copy link
Owner

joukos commented Aug 15, 2018

I created a new issue (#3) for replacing PIL.

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

No branches or pull requests

2 participants