-
Notifications
You must be signed in to change notification settings - Fork 47
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
Flake 8 - StringIO wrapper error with [FLAKE8 - AttributeError: '_io.StringIO' object has no attribute 'buffer'] #81
Comments
I forceably downgraded flake 4.0.1 to 3.9.2 in my Pipfile so the updated version looks like:
and it started working again, so there is something going on with the new flake 4.0.1 |
My PR to fix this on the flake8 side had been rejected. :-( |
This is more an integration issue between flake9 and pytests's "py.io.StdCapture" class. Sadly, flake8 developer seems to be quite adamant that he is developing an CLI tool rather than a library ( https://flake8.pycqa.org/en/latest/user/python-api.html ), so he can claim that the issue should be fixed elsewhere |
That has been the flake8 maintenance team's attitude since flake8 2.x. 3.0 reinforced that. This isn't new and contrary to your implications isn't arbitrary |
I did not try to imply anything, sir. Just described my findings on the subject to help the libraries maintainer. I have no desire running circles around three product teams trying to convenience someone to do something. I'm not associated with any of the projects so I don't have any intrinsic stakes in any of them succeeding. |
I did choose to raise PR against flake8 just because I thought that that change contributed to the Python community the most. Rather than py.io that seems mostly dead or pytest-flake8 integration that isn't doing anything that usual or bad. |
I've encountered the same exception:
Problem only occured with |
If you can live with dropping support for Python 2, #82 might fix this. |
In PyCQA/flake8#1419, this issue was reported to flake8. I attempted to report the error in pytest-dev/pytest#9217, but was redirected here. |
This fixes tholo/pytest-flake8#81
This fixes tholo/pytest-flake8#81
This fixes tholo/pytest-flake8#81
This fixes tholo/pytest-flake8#81
@VRGhost I agree things were moving kind of slow here, so I understand the urge to fork and republish… But just as a matter of etiquette, when repurposing other people’s efforts in an open source context, I believe it would have been nicer to cherry-pick the commits you like (retaining the original authorship) rather than patch and commit under your own name. Just saying. Best of luck with your fork! |
@erikkemperman Yes, I completely agree that this would've been a better option, thank you for pointing this out. |
@erikkemperman Oh, you've raised that PR. My apologies once again. I didn't mean to appropriate your contribution. |
@VRGhost well, the important thing is that this fix, if that’s what it is, gets in the hands of the community — and perhaps a new custodian is just what this codebase needs, I honestly don’t know enough about its circumstances. It was just meant as friendly advice! |
…le wiating for tholo/pytest-flake8#82 to be merged
…le wiating for tholo/pytest-flake8#82 to be merged (#337)
Avoids tholo/pytest-flake8#81 when using flake8 through pytest-flake8
Thanks for the fix and release in 1.1.0! |
The old pytest command had issues with relative .. imports and requires flake8 to be pinned to <4. PyCQA/flake8#1419 tholo/pytest-flake8#81
Installed flake through pipenv
Please provide the exact, unmodified output of
flake8 --bug-report
Please describe the problem or feature
I have a project where flake aparently works as intended, and when I use the commandline flake it still works to some extent without all the pytest.ini setup, but within the Pipenv project it fails through pytest when it finds an error.
I run flake8:
In all other projects we have it works flawlessly, and I really like the tool :D
In general the error comes when the file contains an error and flake8 tries to write to stdout.
This is my pipfile (removed the internal libs, but they dont wrap output in any way:
checked the locks, and same lib versions as bug-report and:
pytest 6.2.5
pytest-flake8 1.0.7
We have the same setup in other projects without the same issue so I'm a bit confused.
I however suspect something wrap the stdout StringIO so the expected attributes are not accessible by flake when it needs to report its findings.
The text was updated successfully, but these errors were encountered: