Skip to content

Commit

Permalink
Merge pull request #1657 from Leo1998/check-write-access-home
Browse files Browse the repository at this point in the history
check if HOME directory is writeable in getSettingsPath
  • Loading branch information
mscuthbert authored Jan 2, 2024
2 parents a938a8c + 2e60ff1 commit 7c719f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion music21/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def getSettingsPath(self):
return directory / 'music21-settings.xml'
elif platform in ['nix', 'darwin']:
# might not exist if running as nobody in a webserver...
if 'HOME' in os.environ:
if 'HOME' in os.environ and os.access(os.environ['HOME'], os.W_OK):
directory = pathlib.Path(os.environ['HOME'])
else:
directory = pathlib.Path('/tmp/')
Expand Down

0 comments on commit 7c719f8

Please sign in to comment.