Comments (11)
This problem is solved in https://github.com/hhatto/autopep8/pull/699/files.
This change has also been released in autopep8 v2.0.4.
Please add a new issue if you have problems. Please include a code example of when the problem occurs.
from autopep8.
I got this problem with my pre-commit configuration, the solution was update the hook to the last version.
pycodestyle==2.11.1
autopep8==2.0.4
Python 3.11
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
from autopep8.
I can't find a missing_whitespace_around_operator
anywhere inside https://github.com/PyCQA/pycodestyle
from autopep8.
I am seeing this issue as well
from autopep8.
Running into this as well. I think https://pypi.org/project/pycodestyle/#history released a breaking change in 2.11.0 that is hitting this. As a temporary fix I'm able to pin pycodestyle to 2.10.0, but ideally autopep8 would be able to handle this out of the box now.
from autopep8.
I can confirm that problem in our code checking also. We use autopep8==2.0.2
and the stack trace is the following:
Traceback (most recent call last):
File "<Project path here>/.venv/bin/autopep8", line 8, in <module>
sys.exit(main())
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 4528, in main
results = fix_multiple_files(args.files, args, sys.stdout)
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 4423, in fix_multiple_files
ret = _fix_file((name, options, output))
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 4393, in _fix_file
return fix_file(*parameters)
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 3589, in fix_file
fixed_source = fix_lines(fixed_source, options, filename=filename)
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 3569, in fix_lines
fixed_source = fix.fix()
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 613, in fix
self._fix_source(filter_results(source=''.join(self.source),
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 557, in _fix_source
modified_lines = fix(result)
File "<Project path here>/.venv/lib/python3.9/site-packages/autopep8.py", line 761, in fix_e225
pycodestyle.missing_whitespace_around_operator(fixed, ts))
AttributeError: module 'pycodestyle' has no attribute 'missing_whitespace_around_operator'
from autopep8.
There are several pull requests for this; #699, #696, #691, #690 are all the same. I suggest someone look into this comment and push their PR forward with a solution.
from autopep8.
This is a possible solution that allows pycodestyle >= 2.11.0.
#696
from autopep8.
For the records, I had the same problem with pycodestyle 2.10.0. Just now, I tried it with 2.11.1 and it seems to be solved.
from autopep8.
Is solution to this error avaiable now or we have to wait?
Errors still remains on my setup (python 3.11) :
pycodestyle==2.11.1
autopep8==2.0.4
from autopep8.
I got this problem with my pre-commit configuration, the solution was update the hook to the last version.
pycodestyle==2.11.1 autopep8==2.0.4 Python 3.11
- repo: https://github.com/pre-commit/mirrors-autopep8 rev: v2.0.4 hooks: - id: autopep8
That worked, thanks !
from autopep8.
Related Issues (20)
- sdist is missing test/acid.py
- Exclude Regex is not working for formatOnSave with vscode autopep8 extension
- migrate to pyproject.toml
- missing dependency on `packaging` HOT 1
- Test failures with Python 3.12 HOT 2
- Pyproject.toml is ignored if ~/.config/pycodestyle have select key filled
- Account for whitespace-only separation of flake8 error selectors/ignores
- Problem with formatting f-strings on python3.12 HOT 20
- Argument parser errors are printed without a trailing newline HOT 1
- Should be able to run autopep8 independently of global pycodestyle config
- Some messages written to stdout instead of stderr HOT 1
- --max-line-length not working.
- ModuleNotFoundError: No module named 'lib2to3' (python3.12) HOT 2
- How to ignore the two-spaces-before-comment rule ? HOT 1
- Dismatch between autopep8 and pep8? HOT 1
- Comments are always formatted at 80 characters maximum
- autopep8 line length not working with async def function
- Questions about Copilot + Open Source Software Hierarchy HOT 1
- Please delete this useless lib
- Inserting newlines into triple-quoted f-strings on Python 3.12 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autopep8.