Author giampaolo.rodola
Recipients Preston Moore, giampaolo.rodola, vstinner, zach.ware
Date 2018-07-14.10:58:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> For example, os.stat() accepts both a filename (string) or a file descriptor (integer).

Interesting. I never realized that. Other functions involved in file copy are:


I checked and it appears they all support fd args (this is not documented and it should). os.path.* all use os.stat() internally so they can easily be replaced. I wonder whether this can introduce any change in semantic though:

>>> import os
>>> os.stat('foobar')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'foobar'
>>> os.stat(333)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 9] Bad file descriptor: 333

Also wonder it this would play nice on Windows.
Date User Action Args
2018-07-14 10:58:26giampaolo.rodolasetrecipients: + giampaolo.rodola, vstinner, zach.ware, Preston Moore
2018-07-14 10:58:25giampaolo.rodolasetmessageid: <>
2018-07-14 10:58:25giampaolo.rodolalinkissue30400 messages
2018-07-14 10:58:25giampaolo.rodolacreate