This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Hans Lawrenz, martin.panter
Date 2015-11-24.08:39:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks for the strace output. I think the actual error is the fstat() call a bit after that first open() call. FileNotFoundError is ENOENT:

open("/vagrant/tmpy5ioznh4", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0600) = 4
unlink("/vagrant/tmpy5ioznh4")          = 0
fstat(4, 0x7ffc0b326520)                = -1 ENOENT (No such file or directory)
close(4)                                = 0
write(2, "Traceback (most recent call last"..., 35Traceback (most recent call last):

My theory is that the fstat() call at <> is failing, probably because the file entry has been removed from its directory. This call was added by revision 3b5279b5bfd1 (Issue 21679). Before this change, fstat() was called twice, but in each case an error was tolerated.

Posix does not mention fstat() returning this ENOENT error, so maybe this could be a bug with the Virtual Box or Vagrant driver for the mounted filesystem. But it might be nice to make Python more permissive if fstat() fails, like it was in 3.4.

As a workaround, you may be able to use NamedTemporaryFile, if you are happy for the file to have a name and a directory entry.
Date User Action Args
2015-11-24 08:39:42martin.pantersetrecipients: + martin.panter, Hans Lawrenz
2015-11-24 08:39:42martin.pantersetmessageid: <>
2015-11-24 08:39:42martin.panterlinkissue25717 messages
2015-11-24 08:39:42martin.pantercreate