Skip to content

_get_name_from_path() in Lib/unittest/loader.py fails when src path contains symlinks #149141

@neek78

Description

@neek78

Bug report

Bug description:

This is conceptually somewhat similar to gh-148314

When the path to the source tree is via a symlink, an alternate path to the same will cause _get_name_from_path() to assert, thinking the supplied path is not a sub-path of the src tree. During the run of unittest's test suite, "." is passed as a path which is resolved to an absolute path - which of course doesn't match a symlinked path.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions