pudb icon indicating copy to clipboard operation
pudb copied to clipboard

"Edit preferences" comes up every time I use pdb

Open ghost opened this issue 9 years ago • 10 comments

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 avatar May 17 '15 21:05 ghost

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 avatar May 17 '15 21:05 ghost

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.

asmeurer avatar May 17 '15 21:05 asmeurer

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.

asmeurer avatar May 17 '15 21:05 asmeurer

You could stat the config file.

inducer avatar May 17 '15 21:05 inducer

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.

asmeurer avatar May 17 '15 23:05 asmeurer

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

inducer avatar May 19 '15 06:05 inducer

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 avatar May 16 '17 17:05 belugame

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

asmeurer avatar May 16 '17 18:05 asmeurer

@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

belugame avatar May 17 '17 07:05 belugame

We should probably remove that line.

asmeurer avatar May 17 '17 07:05 asmeurer