adaptive
adaptive copied to clipboard
learner.save creates file with different permissions than open().write
trafficstars
This is annoying when one uses a shared file system, where all other files that are written (with default settings) will be readable by other users but files that are saved with Adaptive are not.
In Adaptive this happens because of atomicwrites, code example:
from atomicwrites import AtomicWriter
with open("test_open", "w") as f:
f.write("hi")
with AtomicWriter("test_adaptive", "wb", overwrite=True).open() as f:
f.write(b"blob")
gives
$ ls -lah test*
-rw-------. 1 a-banijh a-banijh 4 Jun 2 08:33 test_adaptive
-rw-rw-r--. 1 a-banijh a-banijh 2 Jun 2 08:33 test_open
Maybe relevant:
- https://github.com/untitaker/python-atomicwrites/issues/42
- https://github.com/untitaker/python-atomicwrites/pull/11
Tagging @georgwinkler @jbweston