This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Mateusz Kurek, docs@python, eric.araujo, serhiy.storchaka
Date 2017-10-28.09:49:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509184194.41.0.213398074469.issue31871@psf.upfronthosting.co.za>
In-reply-to
Content
É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
History
Date User Action Args
2017-10-28 09:49:54serhiy.storchakasetrecipients: + serhiy.storchaka, eric.araujo, docs@python, Mateusz Kurek
2017-10-28 09:49:54serhiy.storchakasetmessageid: <1509184194.41.0.213398074469.issue31871@psf.upfronthosting.co.za>
2017-10-28 09:49:54serhiy.storchakalinkissue31871 messages
2017-10-28 09:49:54serhiy.storchakacreate