-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of Scope Variable in Exception Block in constants.py #2283
Changes from 2 commits
cf4c772
90e276b
5c6af93
81b2bce
e520f41
0e71792
aed4d2f
dde7e8c
67ad22d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,11 +34,12 @@ | |
# ToDo refactor to generic functions, keep only constants | ||
HOME = os.path.expanduser(f"~{os.path.sep}") | ||
MSUI_CONFIG_PATH = os.getenv("MSUI_CONFIG_PATH", os.path.join(HOME, ".config", "msui")) | ||
_fs = None | ||
if '://' in MSUI_CONFIG_PATH: | ||
try: | ||
_fs = fs.open_fs(MSUI_CONFIG_PATH) | ||
_fs = fs.open_fs(fs.path.dirname(MSUI_CONFIG_PATH)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. look at the idea in the issue. There should be only one attempt for the fs.errors.CreateFailed because it could be a remote system, and it would be good to have a test for describing the problem and evaluating the fix by that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not convinced that fs.path.dirname is correct there. For the default value of |
||
except fs.errors.CreateFailed: | ||
_fs.makedirs(MSUI_CONFIG_PATH) | ||
_fs.makedirs(fs.path.basename(MSUI_CONFIG_PATH)) | ||
except fs.opener.errors.UnsupportedProtocol: | ||
logging.error('FS url "%s" not supported', MSUI_CONFIG_PATH) | ||
else: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't solve the issue. Now it is possible that
.makedirs
is called onNone
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this
_fs = None
line, it should not be necessary.