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 Hans Lawrenz
Recipients Hans Lawrenz, martin.panter
Date 2015-11-24.06:54:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Host OS: Mac OS 10.11.1
Guest OS: Ubuntu Trusty 64
Virtualbox: 4.3.30
Vagrant: 1.7.4

Example with trace thrown:

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ cat 
import tempfile

with tempfile.TemporaryFile(dir="/vagrant") as tf:
    tf.write("testing testing testing\n".encode('utf-8'))

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ python3.5 
Traceback (most recent call last):
  File "", line 4, in <module>
    with tempfile.TemporaryFile(dir="/vagrant") as tf:
  File "/usr/lib/python3.5/", line 753, in TemporaryFile
    newline=newline, encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory

I think the underlying system call that's causing the error (I attached the full strace in case that's helpful):
open("/vagrant", O_RDWR|O_EXCL|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC|0x400000) = -1 EOPNOTSUPP (Operation not supported)

Finally, the mount point looks like this:
vagrant on /vagrant type vboxsf (uid=1000,gid=1000,rw)
Date User Action Args
2015-11-24 06:54:32Hans Lawrenzsetrecipients: + Hans Lawrenz, martin.panter
2015-11-24 06:54:31Hans Lawrenzsetmessageid: <>
2015-11-24 06:54:31Hans Lawrenzlinkissue25717 messages
2015-11-24 06:54:31Hans Lawrenzcreate