Skip to content
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

too-many-function-args with functions inside six.moves.urllib_parse #1965

Closed
mpeterson opened this issue Mar 27, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@mpeterson
Copy link

commented Mar 27, 2018

Description

There seems to be a problem with the usage of urllib.parse through six and how pylint handles it, leading to a too-many-function-args error.

Steps to reproduce

  1. Create file foo.py
  2. Run pylint on it

foo.py

from six.moves import urllib_parse as urlparse

urlparse.urlunparse(
    urlparse.ParseResult('http', '', '', None, None, None)
)

Current behavior

$ pylint foo.py
No config file found, using default configuration
************* Module foo
C:  1, 0: Missing module docstring (missing-docstring)
E:  3, 0: Too many positional arguments for function call (too-many-function-args)

----------------------------------------------------------------------
Your code has been rated at -20.00/10 (previous run: -20.00/10, +0.00)

That would result in a too-many-function-args error from PyLint on urlunparse, as you can see.

Expected behavior

The linter succeeds without the too-many-function-args error.

pylint --version output

$ pylint --version
No config file found, using default configuration   
pylint 1.8.3,                                       
astroid 1.6.2
$ python -c 'import six; print(six.__version__)'
1.11.0
$ python --version
Python 2.7.14

PCManticore added a commit to PyCQA/astroid that referenced this issue Mar 28, 2018

Improve the six urllib functions for Python 2 by setting them as inst…
…ance attributes

Because they were at the class level, we were considering them BoundMethods, resulting
in a too-many-function-args error when calling these functions.
Close PyCQA/pylint#1965
@PCManticore

This comment has been minimized.

Copy link
Member

commented Mar 28, 2018

This is fixed now in astroid 1.6, we'll just have to release it.

clrpackages pushed a commit to clearlinux-pkgs/astroid that referenced this issue Apr 6, 2018

[update to 1.6.3] Use .path for inferring a module's __path__ attribu…
…te. Close #528:

Chris Philip (1):
      fix nested namespace package import

Claudiu Popa (3):
      Improve the six urllib functions for Python 2 by setting them as instance attributes
      Use .path for inferring a module's __path__ attribute. Close #528:
      Prepare 1.6.3

2018-04-05 -- 1.6.3

   * Fixes nested namespace package import for old-style namespace packages

   * Use .path for inferring a module's __path__ attribute. Close #528

   * Improve the six urllib functions for Python 2 by setting them as instance attributes

    Because they were at the class level, we were considering them BoundMethods, resulting
    in a too-many-function-args error when calling these functions.
    Close PyCQA/pylint#1965

openstack-gerrit pushed a commit to openstack/networking-odl that referenced this issue Apr 18, 2018

Revert temporary patch that disables linter errors locally
A previous patch [1] added local disables for linter errors caused by a
bug in astroid 1.6.2 [2] that was fixed.

This patch reverts the local disables of pylint and updates the
test-requirements file to reflect the needed version.

[1]: https://review.openstack.org/554832
[2]: PyCQA/pylint#1965

Change-Id: I3c19979498a1c7c389993e2f3d7e12089e08e14f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.