pudb
pudb copied to clipboard
"Edit preferences" comes up every time I use pdb
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.
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.
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 https://github.com/inducer/pudb/blob/1b3ee789081f954f99144f3d1bb6f213120b5cb6/pudb/settings.py#L56 should be modified to display the error to the user so that they can see what is going on.
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.
You could stat the config file.
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.
I was more suggesting noticing a non-writable config file in $HOME and warning about it.
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.
@belugame can you try removing the except
mentioned above. It might be swallowing some unrelated error.
@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
We should probably remove that line.