Skip to content

Issues accessing PurePath.parents by index in Python 3.10 #5832

@merelcht

Description

@merelcht

Bug description

We're running pylint as part of our CircleCI builds, which we run on Python 3.7, 3.8, 3.9 and have now added 3.10.

We're using pylint version 2.12.2, and the checks succeed on all versions < python 3.10, but on 3.10 we see the following errors:

E1101: Instance of 'tuple' has no 'resolve' member (no-member)
for:

starter_path = Path(__file__).parents[3].resolve()

I0021: Useless suppression of 'abstract-class-instantiated' (useless-suppression)
for:

from filelock import FileLock

root_tmp_dir = tmp_path_factory.getbasetemp().parent
lock = root_tmp_dir / "semaphore.lock"
    with FileLock(lock):  # pylint: disable=abstract-class-instantiated
          spark = _setup_spark_session()

If the above failures are fixed for Python 3.10 the checks will then fail on all builds with version < Python 3.10.

Command used

pylint -j 4 --disable=missing-docstring,redefined-outer-name,no-self-use,invalid-name,protected-access,too-many-arguments,too-many-public-methods,use-implicit-booleaness-not-comparison tests

Pylint output

This is the output for the 3.10 build:

************* Module tests.framework.cli.conftest
tests/framework/cli/conftest.py:117:19: E1101: Instance of 'tuple' has no 'resolve' member (no-member)
************* Module tests.extras.datasets.spark.conftest
tests/extras/datasets/spark/conftest.py:38:0: I0021: Useless suppression of 'abstract-class-instantiated' (useless-suppression)

Expected behavior

I would expect pylint to give the same output for the various Python versions.

Pylint version

The versions used for the respective Python builds:

pylint 2.12.2
astroid 2.9.3
Python 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]

pylint 2.12.2
astroid 2.9.3
Python 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0]

pylint 2.12.2
astroid 2.9.3
Python 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0]

pylint 2.12.2
astroid 2.9.3
Python 3.10.0 (default, Dec 21 2021, 13:36:04) [GCC 7.5.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions