Skip to content

modifiedBlankLines() takes 7 positional arguments but 9 were given #138

@jfhbrook

Description

@jfhbrook

When running twisted's linting tox task, I got a traceback like this:

Traceback (most recent call last):
  File "/home/josh/software/jfhbrook/twisted/build/lint/bin/twistedchecker", line 10, in <module>
    sys.exit(main())
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/twistedchecker/core/runner.py", line 439, in main
    runner.run(sys.argv[1:])
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/twistedchecker/core/runner.py", line 315, in run
    self.linter.check(args)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pylint/lint.py", line 736, in check
    self._do_check(files_or_modules)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pylint/lint.py", line 867, in _do_check
    self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pylint/lint.py", line 947, in check_astroid_module
    walker.walk(ast_node)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pylint/utils.py", line 935, in walk
    cb(astroid)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/twistedchecker/checkers/pycodestyleformat.py", line 182, in visit_module
    recorder = PyCodeStyleWarningRecorder(node.file)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/twistedchecker/checkers/pycodestyleformat.py", line 50, in __init__
    self.run()
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/twistedchecker/checkers/pycodestyleformat.py", line 79, in run
    pycodestyle.Checker.check_all(self)
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pycodestyle.py", line 2114, in check_all
    self.check_logical()
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pycodestyle.py", line 1999, in check_logical
    for offset, text in self.run_check(check, argument_names) or ():
  File "/home/josh/software/jfhbrook/twisted/build/lint/lib/python3.5/site-packages/pycodestyle.py", line 1928, in run_check
    return check(*arguments)
TypeError: modifiedBlankLines() takes 7 positional arguments but 9 were given

I think what happened was that pycodestyle updated its list of arguments for its blank lines check, such that it doesn't match with modifiedBlankLinesCheck anymore.

I think this can be fixed by naively introducing the new arguments, but I haven't investigated the changes deeply enough to understand what the new parameters are for or whether the core API has changed enough to require a refactor of modifiedBlankLines beyond just changing the call signature. That said I was able to get the step to pass by modifying call signature in the code installed in my tox environment directly, so I suspect the changes are minor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions