Message268792
My environment:
Windows as host OS, VirtualBox VM, Linux as guest OS
When temporary directory is a directory which mounted from the host OS, a "OSError: [Errno 26] Text file busy" exception is thrown.
Test file:
import tempfile
with tempfile.TemporaryFile(dir="/tmp") as tf:
tf.write("testing testing testing\n".encode('utf-8'))
print("Temp file: worked")
"/tmp" directory - is a shared folder (vboxsf)
Result:
0e87f2561643">root@0e87f2561643:/# python /etc/odoo/tempfile-test.py
Traceback (most recent call last):
File "/etc/odoo/tempfile-test.py", line 3, in <module>
with tempfile.TemporaryFile(dir="/tmp") as tf:
File "/usr/lib/python2.7/tempfile.py", line 513, in TemporaryFile
_os.unlink(name)
OSError: [Errno 26] Text file busy: '/tmp/tmpsl0JQI'
0e87f2561643">root@0e87f2561643:/# python --version
Python 2.7.11+
0e87f2561643">root@0e87f2561643:/# python
Python 2.7.11+ (default, Jun 2 2016, 19:34:15)
[GCC 5.3.1 20160528] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'2.7.11+ (default, Jun 2 2016, 19:34:15) \n[GCC 5.3.1 20160528]'
>>> |
|
Date |
User |
Action |
Args |
2016-06-18 10:35:39 | Oleg Babintsev | set | recipients:
+ Oleg Babintsev, pitrou, vstinner, python-dev, martin.panter, serhiy.storchaka, bkabrda, abarry, Hans Lawrenz |
2016-06-18 10:35:39 | Oleg Babintsev | set | messageid: <1466246139.27.0.206284878089.issue25717@psf.upfronthosting.co.za> |
2016-06-18 10:35:39 | Oleg Babintsev | link | issue25717 messages |
2016-06-18 10:35:38 | Oleg Babintsev | create | |
|