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

"Edit preferences" comes up every time I use pdb #139

Open
ghost opened this issue May 17, 2015 · 10 comments
Open

"Edit preferences" comes up every time I use pdb #139

ghost opened this issue May 17, 2015 · 10 comments

Comments

@ghost
Copy link

ghost commented May 17, 2015

I assume there is a way to fix this, but I haven't found this after 15 minutes. It would be great if the Edit Preferences page told you how to suppress it on the next pudb launch.

@ghost
Copy link
Author

ghost commented May 17, 2015

Wow, I finally solved this right after submitting this issue. Somehow my ~/.config/pudb folder was owned by root. Running sudo chown -R stewartr:stewartr ~/.config/pudb fixed the problem. It would have been nice if pudb told me it was getting permission denied when trying to write files though.

@ghost ghost closed this as completed May 17, 2015
@asmeurer
Copy link
Collaborator

Right. The preferences are opened when the welcome message hasn't been seen before. It looks like if the config file can't be loaded, then some defaults are used, which include showing the welcome message. Probably the except at

except:
should be modified to display the error to the user so that they can see what is going on.

@asmeurer asmeurer reopened this May 17, 2015
@asmeurer
Copy link
Collaborator

Actually it looks like ConfigParser itself ignores errors (so that except doesn't really do anything). See https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read. I suppose this is intended behavior, since the idea is that it seamlessly falls back to the first XDG config file that it can read. So I'm not sure how this should be handled.

@inducer
Copy link
Owner

inducer commented May 17, 2015

You could stat the config file.

@asmeurer
Copy link
Collaborator

Sure. But it seems like unreadable config files is one of the use cases of having multiple config paths. I could be wrong about that though.

@inducer
Copy link
Owner

inducer commented May 19, 2015

I was more suggesting noticing a non-writable config file in $HOME and warning about it.

@belugame
Copy link

I'm encountering this issue too on two different *buntu-based machines. I m using it running unit tests with tox 2.7 inside a virtual env. Permissions should not be a problem:

ls  -l $HOME/.config/pudb
-rwxrwxrwx 1 myuser myuser 302 Mai 16 19:19 pudb.cfg

Nothing is written to that file while pudb is active or after it is closed.

@asmeurer
Copy link
Collaborator

@belugame can you try removing the except mentioned above. It might be swallowing some unrelated error.

@belugame
Copy link

@asmeurer Thank you, configparser shadowed an IOError indeed that is in my project setup.

IOError: [Errno 2] No such file or directory: '/home/myuser/.config/flake8

@asmeurer
Copy link
Collaborator

We should probably remove that line.

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

Successfully merging a pull request may close this issue.

3 participants