-
Notifications
You must be signed in to change notification settings - Fork 28
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
TypeError: expected str, bytes or os.PathLike object, not TextIOWrapper. Why extra " -" is being added after flake8 --format default
?
#127
Comments
The The last line that throws shows |
@kaste There is A LOT of flake8 plugins involved. I've just installed all of the requirements from this project - https://github.com/tough-dev-school/education-backend/blob/master/dev-requirements.txt I'll try to delete the flake8 mock. Not sure if this is a right decision in the long term. If this plugin is in project's requirements it probably should be used. |
With flake8 mock uninstalled the error is now in flake8 pytest
|
Very unfortunate. These plugins and dependencies are pretty outdated as it seems. They don't support stdin input which is a normal feature of flake8 we require here as otherwise we can't run while you're typing in the editor. Actually your teachers should update the educational project; they pin flake8 to 3.x although we're on 5.x already and imo all plugins to flake8 should be selected so they support all common core feature of flake8. Unfortunately it is not pluggable here to run on stdin or only on save where we could use the normal file names as on the CLI. The safer, defensive approach from our side would be to support that and maybe automatically switch operation modes here. (Actually #106 would do this if you switch the Honestly, it is not clear why an educational, beginner project should need that many dependencies IMO. dependencies need to get managed which just adds more work to the teachers. |
TLDR; we require from flake8 more feature than we need as a bare minimum. they ("you" or your teachers) pin to flake8 plugins not fully supporting the flake8 standard feature set. |
@kaste oh, thanks. It's not really an educational project. Name is kinda misleading. It's a project for an educational web-site where you can buy courses etc. It's started working perfectly, when I deleted flake8-pytest |
Flake8 works great when using it manually in command line. Doesn't work in Sublime. It seems like this command is wrong "cat src/app/conf/db.py | /home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8 --format default -"
Ubuntu 22.04
Sublime Text Build 4126
Python 3.10.4
Venv
Console output:
Settings:
I've noticed the line
cmd = ('flake8', '--format', 'default', '${args}', '-')
. Didn't dig deep enough to know why '-' is needed here. When I've tried to remove '-', thinking it will make sublime linter construct the command without extra '-' being added. No, it's not not that simple. Though it looks like the flake8 command is ok in this case.The text was updated successfully, but these errors were encountered: