Sujet : Re: FileNotFoundError thrown due to file name in file, rather than file itself
De : dieter.maurer (at) *nospam* online.de
Groupes : comp.lang.pythonDate : 13. Nov 2024, 19:36:04
Autres entêtes
Message-ID : <mailman.105.1731522974.4695.python-list@python.org>
References : 1 2 3 4 5
User-Agent : VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid (x86_64-linux-gnu)
Loris Bennett wrote at 2024-11-12 10:00 +0100:
...
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.
This is what happens usually:
if you open a file with mode `a` or `w`, the file is created
if it does not yet exist.
Thus, a missing log file should not give you the `FileNotFound`
exception.
Look at the exception details: they should tell you what really
was not found (maybe the directory for the logfile).
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 |