Skip to content
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

Permission settings for save_config() function #3

Closed
mfogelson opened this issue Dec 10, 2018 · 3 comments
Closed

Permission settings for save_config() function #3

mfogelson opened this issue Dec 10, 2018 · 3 comments

Comments

@mfogelson
Copy link

When running robot.save_config() you get:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/dorna-1.3-py3.6.egg/dorna/config.yaml'

This goes away if you run sudo or sudo -s before running the script, but maybe you could change the permissions when downloading everything?

@smhty smhty closed this as completed Dec 10, 2018
@smhty smhty reopened this Dec 10, 2018
@smhty
Copy link
Collaborator

smhty commented Dec 10, 2018

This is a problem with Linux and Mac.
I actually don't know about your suggestion: "maybe you could change the permissions when downloading everything". If you can explain it more to me.
One option is to the make sure that the user has a sudo access when they are initializing the Dorna object.

@justinclift
Copy link

justinclift commented Dec 11, 2018

Ahhh. The path this is showing points out the problem:

PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/dorna-1.3-py3.6.egg/dorna/config.yaml'

On most versions of *nix, paths like /usr/local/lib/ ... are kept for system files. It sounds like the dorna-1.3 files are being installed there, which is the correct place. Those paths are generally considered "read only", because user software shouldn't have write access to system paths. 😉

The general approach is to have user software save config value to the user's home directory (eg $HOME/.dorna/config.yaml). That keeps the separation between system software + user saved values.

Does that help? 😄

@mfogelson
Copy link
Author

Yes,
These suggestions all make sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants