Skip to content

learner.save creates file with different permissions than open().write #282

Open
@basnijholt

Description

@basnijholt

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:

Tagging @georgwinkler @jbweston

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions