Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Éric, see https://docs.python.org/3/library/os.html#files-and-directories.

Yes, now some os.path functions can accept a file descriptor as a path. I don't 
think this is intentional. And this may not work on all platforms.

>>> os.path.isdir(1)
False
>>> os.path.islink(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/posixpath.py", line 169, in islink
    st = os.lstat(path)
TypeError: lstat: path should be string, bytes or os.PathLike, not int

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31871>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to