Skip to content

pathlib.Path.parents brain doesn't handle when parents is assigned to a variable #2864

@felixfontein

Description

@felixfontein

Bug description

On Python 3.14 with pylint 4.0.1, process this Python file:

# pylint: disable=missing-module-docstring
from pathlib import Path

cwd = Path.cwd()
parents = cwd.parents
print(parents[0].name)

This produces:

t.py:6:6: E1101: Instance of 'tuple' has no 'name' member (no-member)

This does not happen with Python 3.13.

(Related issue in the past: pylint-dev/pylint#5832)

Configuration

Command used

pylint t.py

Pylint output

************* Module t
t.py:6:6: E1101: Instance of 'tuple' has no 'name' member (no-member)

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

Expected behavior

Pylint passes without reporting errors.

Pylint version

pylint 4.0.1
astroid 4.0.1
Python 3.14.0 (main, Oct  8 2025, 21:26:41) [GCC 14.2.0]

OS / Environment

python:3.14-slim Docker container with pip install pylint

Additional dependencies

Metadata

Metadata

Assignees

Labels

Brain 🧠Needs a brain tipBug 🪳Needs PRThis issue is accepted, sufficiently specified and now needs an implementation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions