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
fixing commands fail when no folder #6825
fixing commands fail when no folder #6825
Conversation
I am moving this to draft. This responsibility is implemented already in the conan_api decorator, and in this point it wouldn't be necessary. The fix doesn't correct the error in the conan_api decorator. |
Moved responsibility to api, removed from |
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.
Not a review, just a comment:
There are many places in Conan where we are calling os.getcwd
or get_cwd
(btw, why this file and comment?). This same cryptic error can be raised at any of those places.
Before this PR, Conan was failing at the very beginning, now Conan can fail with this exception at many different places. I'm not sure if it is better to raise a meaningful error than to protect/bypass at this point.
wdyt?
I have checked the code, in practice, many commands that do not require the current path (search, remove, upload), do not use For other commands, yes the error will be equally cryptic, and raised at different places. We could wrap in the |
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
Changelog: Fix: Avoid failures that happen when Conan runs in a non-existing folder.
Docs: Omit
Close #6075
It also includes some minor pep8 fixes in the command.py file