Sujet : Re: FileNotFoundError thrown due to (Posting On Python-List Prohibited)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.pythonDate : 11. Nov 2024, 22:05:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vgtrim$15srv$5@dont-email.me>
References : 1
User-Agent : Pan/0.160 (Toresk; )
On Mon, 11 Nov 2024 15:05:56 +0100, Loris Bennett wrote:
except FileNotFoundError:
print(f"Error: configuration file {args.config_file} not found.
Exiting.")
sys.exit(0)
and when I ran the program I got the error
Error: configuration file /usr/local/etc/sc_mailer not found.
Exiting.
However, this file *does* exist and *can* be read.
This is your own fault for intercepting the exception and printing out
your own misleading error message. If you had left the exception uncaught,
it would have printed out the right file name.
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 |