Skip to content

Commit

Permalink
Try cache mkdir in XDG handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 authored Oct 17, 2024
1 parent b2f6dec commit 28287eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scapy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def _probe_xdg_folder(var, default, *cf):
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
# "If, when attempting to write a file, the destination directory is
# non-existent an attempt should be made to create it with permission 0700."
path.mkdir(mode=0o700, exist_ok=True)
try:
path.mkdir(mode=0o700, exist_ok=True)
except Exception:
# There is a gazillion ways this can fail. Most notably,
# a read-only fs.
return None
return path.joinpath(*cf).resolve()


Expand Down

0 comments on commit 28287eb

Please sign in to comment.