Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions electrum/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def write_json_file(path, data):
raise FileExportFailed(e)


def os_chmod(path, mode):
def os_chmod(path, mode, critical=False):
"""os.chmod aware of tmpfs"""
try:
os.chmod(path, mode)
Expand All @@ -1120,7 +1120,9 @@ def os_chmod(path, mode):
if xdg_runtime_dir and is_subpath(path, xdg_runtime_dir):
_logger.info(f"Tried to chmod in tmpfs. Skipping... {e!r}")
else:
raise
if critical:
raise
_logger.info(f"Best-effort chmod failed: {e!r}")


def make_dir(path, allow_symlink=True):
Expand Down