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 <1400244951.11.0.134859155619.issue21515@psf.upfronthosting.co.za>
In-reply-to
Content
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:
https://btrfs.wiki.kernel.org/index.php/Project_ideas#Implement_O_TMPFILE_support

--

It looks like os.open() 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
4259840
>>> f=tempfile.TemporaryFile(dir='.')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/haypo/prog/python/default/Lib/tempfile.py", line 507, in TemporaryFile
    fd = _os.open(dir, flags, 0o600)
OSError: [Errno 95] Operation not supported: '.'

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