Skip to content

Commit

Permalink
check if HOME directory is writeable
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo1998 committed Oct 23, 2023
1 parent a938a8c commit 2e60ff1
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 2e60ff1

Please sign in to comment.