Skip to content

pathlib is_dir gives wrong result for mounted USB flash drive #104806

Description

@bobjalex

Bug report

A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.

Your environment

  • CPython versions tested on:
  • Operating system and architecture:

Activity

  1. bobjalex commented on May 23, 2023

    @bobjalex
    Author

    I'm having trouble entering data into the report proper, so entering it in a comment:
    CPython version 3.12b1
    My environment: Windows 11 laptop 64bit

    Using pathlib.is_dir for a directory on a mounted USB drive answers False, but os.path.isdir gives the correct answer: True. pathlib.is_dir works fine for the C:\ drive.

    Attached is a little program that shows the problem.
    is_dir.py.txt

  2. bobjalex commented on May 23, 2023

    @bobjalex
    Author

    Oops, I left this out:
    My output from the attached program:

    python is_dir.py
    using os.path: True
    using pathlib: False
    using os.path: True
    using pathlib: True

  3. eryksun commented on May 23, 2023

    @eryksun
    Contributor

    This issue should be resolved by fixing gh-104820.

  4. zooba commented on May 24, 2023

    @zooba
    Member

    Yep, can see this was reported first, but I've already attached the fix to #104820, so closing this as a duplicate.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions