On 20 Apr 2023, at 14:24, Gustaf Waldemarson <gustaf.waldemarson@gmail.com> wrote:


Interesting, are you both sure ./.pdbrc should be the first file? I was expecting
the order to always go from "most general" to "most specific", i.e.,
"system" -> "home" -> "current". This way, it would be straightforward
to have general configuration in a "system"/"home" configuration which can
be overwritten in a more specialized one ("current").

Oh i see you read all the files.
Usually you need to stop looking once you find an rc file.

Barry


Coincidentally, this is also the order GDB is using:

Any particular reason you guys prefer a different order?

> Not your job, but I bet you get "are there other stdlib applications
> that would benefit from this change?" as feedback.  Eg, IDLE.

Probably, but lets start the discussion somewhere!

Best regards,
Gustaf


Den ons 19 apr. 2023 kl 17:11 skrev turnbull <turnbull@sk.tsukuba.ac.jp>:
I apologize for the top-post and awkward trimming, my employer just
switched to o365 and won't accomodate my existing mail client so I'm
stuck with a crappy webmail client on this address. :-p

I agree with Barry on both points: seems like a good idea, but the
search priority should be
./.pdbrc first.

Not your job, but I bet you get "are there other stdlib applications
that would benefit from this change?" as feedback.  Eg, IDLE.

2023-04-19 02:50 に Barry さんは書きました:

>>    +            for rcFileName in ('${XDG_CONFIG_HOME}/python/pdbrc',
>>    +                               '~/.config/python/pdbrc',
>>    +                               '~/.pdbrc',
>>    +                               '.pdbrc'):
> I would expect .pdbrc to be first.
>
>>    +                rcPath =
>> os.path.expanduser(os.path.expandvars(rcFileName))
>>    +                try:
>>    +                    with open(rcPath, encoding='utf-8') as rcFile:
>>    +                        self.rcLines.extend(rcFile)
>>    +                except OSError:
>>    +                    pass
>>
>>             self.commands = {} # associates a command list to
>> breakpoint numbers
>>             self.commands_doprompt = {} # for each bp num, tells if
>> the prompt
>
> Try raising a python bug and a PR with this code in it.
> Seems reasonable change to support.
>
> Barry