Sujet : Re: FileNotFoundError thrown due to file name in file, rather than file itself
De : loris.bennett (at) *nospam* fu-berlin.de (Loris Bennett)
Groupes : comp.lang.pythonDate : 12. Nov 2024, 10:00:36
Autres entêtes
Organisation : FUB-IT, Freie Universität Berlin
Message-ID : <87h68cyggb.fsf@zedat.fu-berlin.de>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Chris Angelico <
rosuav@gmail.com> writes:
On Tue, 12 Nov 2024 at 01:59, Loris Bennett via Python-list
<python-list@python.org> wrote:
2. In terms of generating a helpful error message, how should one
distinguish between the config file not existing and the log file not
existing?
>
By looking at the exception's attributes rather than assuming and
hard-coding the path in your message? Or, even better, just let the
exception bubble.
As Dieter also pointed out, I obviously made a mistake in assuming that
I knew what 'FileNotFound' was referring to.
However, it strikes me as not immediately obvious that the logging file
must exist at this point. I can imagine a situation in which I want to
configure a default log file and create it if it missing.
Cheers,
Loris
-- This signature is currently under constuction.
Date | Sujet | # | | Auteur |
11 Nov 24 | FileNotFoundError thrown due to file name in file, rather than file itself | 25 | | Loris Bennett |
11 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 17 | | Left Right |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 16 | | Loris Bennett |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 3 | | Left Right |
13 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 2 | | Greg Ewing |
13 Nov 24 | Re: FileNotFoundError thrown due to (Posting On Python-List Prohibited) | 1 | | Lawrence D'Oliveiro |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Mats Wichmann |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Chris Angelico |
13 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 2 | | Loris Bennett |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Barry |
13 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Roel Schroeven |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Michael Torrie |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Left Right |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Chris Angelico |
13 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | D'Arcy Cain |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Ethan Furman |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 2 | | Michael Torrie |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Jon Ribbens |
11 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | dieter.maurer |
11 Nov 24 | Re: FileNotFoundError thrown due to (Posting On Python-List Prohibited) | 1 | | Lawrence D'Oliveiro |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 5 | | Chris Angelico |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 3 | | Loris Bennett |
13 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | dieter.maurer |
14 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Kushal Kumaran |
12 Nov 24 | Re: FileNotFoundError thrown due to file name in file, rather than file itself | 1 | | Loris Bennett |