- move the umask call before the try/except block
- move comment in _prepare_single to the umask call
Simplify the code comments, too.
Tests still pass.
Thanks to @aburch's suggestions, the logic has been changed:
- Set umask before creating folders and files
- Leverage os.makedirs' mode option in conjunction with umask
The program still tries to change owner / group, but in case of errors
it continues gracefully.
Tests have been updated, and they pass.