fghzxm ยท GitHub

@fghzxm

Copy link Copy Markdown

Contributor

No description provided.

@mhils

Copy link Copy Markdown

Member

Thanks! Can we move this into a decorator to simplify things and add a test?

I'm thinking of something like this, which could be tested in isolation:

@contextmanager
def umask_owner_readable():
    original_umask = os.umask(0)
    os.umask(original_umask | 0o77)
    try:
        yield
    finally:
        os.umask(original_umask)
def test_umask_owner_readable():
    with umask_owner_readable():
        # write file
    # test permissions

@fghzxm

Copy link Copy Markdown

Contributor Author

@mhils Thanks for your advice. I have updated my branch.

@mhils

mhils commented

Oct 22, 2018

โ€ข

edited

Loading

Copy link Copy Markdown

Member

Awesome! Thank you so much for the quick turnaround, really appreciated. I'm not sure if Windows tests will be passing (we may just want to exclude them), but first it looks like GitHub needs to get things in order :)

@mhils

Copy link Copy Markdown

Member

Thanks again! This looks good to merge once CI passes. ๐Ÿฐ ๐ŸŽ‰

@kajojify

Copy link Copy Markdown

Contributor

Thank you very much for the PR! Merging.

@kajojify

@fghzxm

Read the original on github.com โ†—