[New-bugs-announce] [issue47198] os.stat on windows doesn't take an open file even though os.stat in os.supports_fd

Joe Cool report at bugs.python.org
Fri Apr 1 23:51:52 EDT 2022


New submission from Joe Cool <snoopyjc at gmail.com>:

os.stat on windows doesn't take an open file even though os.stat in os.supports_fd

>>> fd = open('tmp.tmp', 'w')
>>> fd
<_io.TextIOWrapper name='tmp.tmp' mode='w' encoding='cp1252'>
>>> os.stat(fd)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: stat: path should be string, bytes, os.PathLike or integer, not TextIOWrapper
>>> os.stat in os.supports_fd
True

----------
messages: 416535
nosy: snoopyjc
priority: normal
severity: normal
status: open
title: os.stat on windows doesn't take an open file even though os.stat in os.supports_fd
type: behavior
versions: Python 3.10

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


More information about the New-bugs-announce mailing list