cpython icon indicating copy to clipboard operation
cpython copied to clipboard

pathlib.Path.unlink raises a `NotADirectoryError` if some element of the path is actually a file - this is undocumented

Open MusicalNinjaDad opened this issue 8 months ago • 8 comments

Documentation

https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink states that a FileNotFoundError will be raised if the path does not exist. On macos-14 a NotADirectoryError is raised if the directory does not exist.

See pypa/cibuildwheel#1850 for an example.

Linked PRs

  • gh-120049

MusicalNinjaDad avatar Jun 03 '24 17:06 MusicalNinjaDad