Skip to content

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

Closed as not planned

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. added
    type-bug
    on May 23, 2023
  2. 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

  3. 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

  4. eryksun commented on May 23, 2023

    @eryksun
    Contributor

    This issue should be resolved by fixing gh-104820.

  5. added
    3.12
    3.13
    on May 23, 2023
  6. 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

    3.123.13OS-windowstopic-pathlibtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions