[New-bugs-announce] [issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

Kirill Balunov report at bugs.python.org
Fri Jul 26 03:23:57 EDT 2019


New submission from Kirill Balunov <kirill.balunov at gmail.com>:

In the documentation it is said that os.path.isdir(...) an Path(...).is_dir()are equivalent substitutes.
https://docs.python.org/3/library/pathlib.html#correspondence-to-tools-in-the-os-module

But they give different result for empty path strings:
>>> import os
>>> from pathlib import Path
>>> dummy = "" 
>>> os.path.isdir(dummy)
 False

Obviously it's not an equivalence, so either this should be noted in the documentation or corrected in the code.

----------
assignee: docs at python
components: Documentation, Library (Lib)
messages: 348475
nosy: docs at python, godaygo
priority: normal
severity: normal
status: open
title: The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37688>
_______________________________________


More information about the New-bugs-announce mailing list