Author vstinner
Recipients georg.brandl, ncoghlan, neologix, pitrou, vstinner
Date 2014-05-16.12:55:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It looks like O_TMPFILE is supported by tmpfs (3.11), ext3 (3.11), ext4 (3.11), XFS (3.15). It looks like BTRFS will also support the O_TMPFILE:


It looks like fails with OSError(95, 'Operation not supported') if the filesystem of the directory doesn't support TMPFILE. In this case, a fallback to the current implementation should be enough. I don't think that we need to remember that the directory doesn't support TMPFILE. The directory may be on a different filesystem at the next call.

haypo@smithers$ ~/prog/python/default/python 
Python 3.5.0a0 (default:5e98a50e0f55, May 16 2014, 10:44:10) 
>>> import tempfile
>>> tempfile._O_TMPFILE
>>> f=tempfile.TemporaryFile(dir='.')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/haypo/prog/python/default/Lib/", line 507, in TemporaryFile
    fd =, flags, 0o600)
OSError: [Errno 95] Operation not supported: '.'

haypo@smithers$ df .
Sys. de fichiers   Taille Utilisé Dispo Uti% Monté sur    96G    9,1G   83G  10% /home/haypo/nfs
Date User Action Args
2014-05-16 12:55:51vstinnersetrecipients: + vstinner, georg.brandl, ncoghlan, pitrou, neologix
2014-05-16 12:55:51vstinnersetmessageid: <>
2014-05-16 12:55:51vstinnerlinkissue21515 messages
2014-05-16 12:55:50vstinnercreate