false positive on pkg_resources.get_distribution #1390

Closed
powersj opened this Issue Mar 21, 2017 · 3 comments

Comments

Projects
None yet
3 participants

powersj commented Mar 21, 2017

Steps to reproduce

The following Python code

from pkg_resources import get_distribution
print get_distribution('requests').version
print dir(get_distribution('requests'))

Produces the following output:

2.13.0
['EQEQ', 'PKG_INFO', '__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_compute_dependencies', '_dep_map', '_get_metadata', '_key', '_parsed_pkg_info', '_provider', '_reload_version', '_version', '_warn_legacy_version', 'activate', 'as_requirement', 'check_version_conflict', 'clone', 'egg_name', 'extras', 'from_filename', 'from_location', 'get_entry_info', 'get_entry_map', 'has_version', 'hashcmp', 'insert_on', 'key', 'load_entry_point', 'location', 'parsed_version', 'platform', 'precedence', 'project_name', 'py_version', 'requires', 'version']

Current behavior

Pylint however complains:

E:  2, 6: Instance of 'str' has no 'version' member (no-member)

This looks identical to #36 but I was not sure what I am doing differently.

Expected behavior

No error message

pylint --version output

$ pylint --version
No config file found, using default configuration
pylint 1.6.5,
astroid 1.4.9
Python 2.7.13 (default, Jan 19 2017, 14:48:08)

Contributor

rogalski commented Mar 22, 2017

Same root cause as in #490. BTW. I think that it may not yet be shipped in latest public release. Do you mind checking it with pylint and astroid from master branches?

powersj commented Mar 22, 2017

@rogalski Looks like using the versions from source did resolve this. Here are the specific versions used:

$ pylint --version
No config file found, using default configuration
pylint 1.7.0,
astroid 1.5.0
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118]

Owner

PCManticore commented Mar 23, 2017

We'll try to release shortly the new version, so this should work soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment