Skip to content

Wrong-case path argument on case-insensitive POSIX file systems (macOS) reports "not found" #15487

Backlog

Description

@RonnyPfannschmidt

🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.

Follow-up from #15482 / #13296.

On Windows, Session.collect falls back to samefile_nofollow when a path argument doesn't equal a collected node's path (#11895), so pytest Reproducer collects reproducer/. #15482 makes the conftest import dedupe on a Path key so that case no longer imports the conftest twice.

On macOS (case-insensitive APFS by default) the fallback doesn't run, so pytest Reproducer stops with no match in any of [<Dir ...>] (exit code 4), even though the directory exists. No double import, just a confusing "not found".

Not urgent: no user report so far, and file identity (st_dev/st_ino, samefile) is unreliable on some Windows setups, so a unified fix needs care. Options if it ever matters: widen the fallback to any platform where os.path.exists finds the path but no node matches, or improve the error message to mention the casing mismatch.

Activity

  1. added
    topic: collection
    platform: mac
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: mactopic: collection

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions