Message305152
É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 |
|
Date |
User |
Action |
Args |
2017-10-28 09:49:54 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, eric.araujo, docs@python, Mateusz Kurek |
2017-10-28 09:49:54 | serhiy.storchaka | set | messageid: <1509184194.41.0.213398074469.issue31871@psf.upfronthosting.co.za> |
2017-10-28 09:49:54 | serhiy.storchaka | link | issue31871 messages |
2017-10-28 09:49:54 | serhiy.storchaka | create | |
|