Difference between os.path.isdir and Path.is_dir

Maksim Fomin mxfm at protonmail.com
Thu Jul 25 13:36:47 EDT 2019


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, July 25, 2019 3:27 PM, Kirill Balunov <kirillbalunov at gmail.com> wrote:

> Hi all! It is expected that:
>
>     >>> import os
>     >>> from pathlib import Path
>     >>> dummy = " "   # or "" or "     "
>     >>> os.path.isdir(dummy)
>
>     False
>     >>> Path(dummy).is_dir()
>
>     True
>
>
> or was it overlooked?
>
> with kind regards,
> -gdg
>
> -------------------------------------------------
>
> https://mail.python.org/mailman/listinfo/python-list

I also cannot reproduce it on linux (python 3.7.3). Which version do you use?



More information about the Python-list mailing list