New submission from Joe Cool <snoop...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue47198>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to