Hans Lawrenz added the comment:

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 tt.py 
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 tt.py 
Traceback (most recent call last):
  File "tt.py", line 4, in <module>
    with tempfile.TemporaryFile(dir="/vagrant") as tf:
  File "/usr/lib/python3.5/tempfile.py", 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)

----------
Added file: http://bugs.python.org/file41145/tempfile-strace.txt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25717>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to