Code Monkey home page Code Monkey logo

Comments (11)

hhatto avatar hhatto commented on June 11, 2024 2

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.

juanreyes00 avatar juanreyes00 commented on June 11, 2024 1

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.

adrianwix avatar adrianwix commented on June 11, 2024

I can't find a missing_whitespace_around_operator anywhere inside https://github.com/PyCQA/pycodestyle

from autopep8.

justindarcy avatar justindarcy commented on June 11, 2024

I am seeing this issue as well
image

from autopep8.

TylerJang27 avatar TylerJang27 commented on June 11, 2024

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.

MiltiadisKoutsokeras avatar MiltiadisKoutsokeras commented on June 11, 2024

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.

shaperilio avatar shaperilio commented on June 11, 2024

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.

keriksson-rosenqvist avatar keriksson-rosenqvist commented on June 11, 2024

This is a possible solution that allows pycodestyle >= 2.11.0.
#696

from autopep8.

ststefa avatar ststefa commented on June 11, 2024

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.

folkien avatar folkien commented on June 11, 2024

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.

essamgouda97 avatar essamgouda97 commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.