Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197015

Re: FileNotFoundError thrown due to file name in file, rather than file itself

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From dieter.maurer@online.de
Newsgroups comp.lang.python
Subject Re: FileNotFoundError thrown due to file name in file, rather than file itself
Date Wed, 13 Nov 2024 19:36:04 +0100
Lines 14
Message-ID <mailman.105.1731522974.4695.python-list@python.org> (permalink)
References <87v7wt986z.fsf@zedat.fu-berlin.de> <CAPTjJmoJErFTE-oS2X_Z+2yC6bMXvHZi0=CxkGhWnVtd4Gacvw@mail.gmail.com> <mailman.96.1731374262.4695.python-list@python.org> <87h68cyggb.fsf@zedat.fu-berlin.de> <26420.61844.597011.839900@ixdm.fritz.box>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de wrdh6G9Gxn1VbyT8ZFvVTQCgcvrhNITorSXmtJovzg5g==
Cancel-Lock sha1:BueLIon+tEd81GN43L/4bHtPYlw= sha256:fiO/1tGQwZY0phKZbaTGCIQkfNU2rsF0enQfeXna9AY=
Return-Path <dieter.maurer@online.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
Authentication-Results mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=online.de header.i=dieter.maurer@online.de header.b=CLdRzBbr; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status OK 0.047
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'received:212.227': 0.07; 'subject:name': 0.07; 'cc:addr:python-list': 0.09; 'skip:` 10': 0.09; 'subject:, \n ': 0.09; 'log': 0.12; 'cc:no real name:2**0': 0.14; 'bennett': 0.16; 'exception.': 0.16; 'cc:addr:python.org': 0.20; 'exception': 0.22; 'subject:file': 0.22; 'received:de': 0.23; 'cc:2**0': 0.25; 'default': 0.31; 'received:kundenserver.de': 0.32; 'received:mout.kundenserver.de': 0.32; 'header:In-Reply-To:1': 0.34; 'really': 0.36; '...': 0.37; 'missing': 0.37; 'directory': 0.37; 'received:192.168': 0.37; 'file': 0.38; 'wrote': 0.39; 'situation': 0.40; 'want': 0.40; 'should': 0.40; 'tell': 0.60; 'mode': 0.62; 'point.': 0.62; 'imagine': 0.64; 'look': 0.65; 'obvious': 0.69; 'happens': 0.84; 'thus,': 0.84; 'subject:than': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=online.de; s=s42582890; t=1731522965; x=1732127765; i=dieter.maurer@online.de; bh=6SqFR+Jf2vIOCfqUCjEPHycY5I7RksnNLorv25o+hTA=; h=X-UI-Sender-Class:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-ID:Date:From:To:Cc:Subject: In-Reply-To:References:cc:content-transfer-encoding:content-type: date:from:message-id:mime-version:reply-to:subject:to; b=CLdRzBbr3BLHwXrkvVDn9dQGFRtRzVBQLcBV0XD/uYXsWGupxd//WZf+tISyS9tG MxOU5VYxTkOJ5fPbk/cQJkquQpv7WxkUxL7GnBZdAOpSAnOazflSIBte261GqwtN1 eWwd8gLWQeokdcopfJiy02O2XPPbihIzGubE6KuFl5tCKu6VXZZfWnPdirZltdi1l ji7a6Y10tUhzs86Jlyx494973nW5dFDk2H8FwEcBzy2qXRZrTGOPIjhxW0gPQWTFc B1ABFGglh80zd1bcHAPBUStXjurPugwYULS1KWRmVMeFsUCsJkHjSU7NLrYKzu+2s 0Vj+VrL3AzkWjrEpog==
X-UI-Sender-Class 6003b46c-3fee-4677-9b8b-2b628d989298
In-Reply-To <87h68cyggb.fsf@zedat.fu-berlin.de>
X-Mailer VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid (x86_64-linux-gnu)
X-Provags-ID V03:K1:frY4DMevQOr8HqMCOv7gt0SnXNYbTsEzUfsA/k99QfhnMPXISIl WJUqibuSifu4SyQnDIXve1GV+1PFMPo8cfizRx/GInqhUjOsZXr7sOksA/qdNgiwzMHARV3 2cShuOfhqKcLdD6WXHyUc9qQOSwbQOvZ74d9HCimJ6O7yLGKLa/4uq1h5Gz6Haji34Qzn6d EFmrvX+pRxVi7QJMU0peQ==
X-Spam-Flag NO
UI-OutboundReport notjunk:1;M01:P0:MLI+75rvP6I=;/84c1uW+vPB/PAp3+c0mQOD8RHS I6RKcl+UQ+Lsw2lwJqS8xIwO5UgSo53oQPRiRIyNDWv6Rjghner6CTe18wl1js2OwUck2eXyx BNTFGBv0EYm737RU+fE7lCjdsQcdkPBbfKkpCfGMTeH2UHCok2FOUZkdfE5Hl9ZcC0uIfgfmR LGdUGOKy1yxhRRvErLwa78PXB8t8wY4u0FW6fWGB33MmA+O+TTJPVKf/Py3wJ6l/jS645e1g4 /wRUxNTrMm5DHsRM25voev0RYM7jkPLQUrpI1jRWZjKWzG0cjmaarYvknTiNcqh2k8ucclbpy 54z/1TZCeFMpP6YeBlNHQ8w9Xa3lsW74ooes0G1GvzSKOX/98Q3wg7xM/+vmkhkfq/YOCWut8 xR9ffn4u17tRC2QmcudJ6B7kXW8CgrQHGjhsz4gNE1bGErjfxFHmA4OOyZMhZa115SQxC6b9r G+xmQZCgCR0aUB33+qaVht7h0t1c0a8pkdjkgyrf1LBLjO8RdoQwbCFYDIqrPmjtkdQmVaYu4 m6saKscsXVn2uidQSlFLKPRb6siMdEI3rfXnVYE3havACMtfdSzL2H/XnuD+WoLw77WomVP6J TKlAugr865SS13jvDrvX3+JD3RbI53Ff4fbcNfdFkdIwFNu9VtkOlSyGDoMFDSbtEnetxTZWA 9Zx6ijMG693tAbE7yIbbz7DV4+8qHMlDUS+llRefREjIT8xMGNy9P5IidGvAHrr9mxGC3ltS7 88dKTJvrW/1hj55YEdLDiN6lJ2HNMsMPWdYJJtfOGOoBPt2+mZajLT8mXTJkKKV3KVsb7eeoC 13E64696q33zhsMGE0Iqic5aVL/40LQPXJXrU1ftBLHaaza3GJdKAbddzeKGy0qUrn
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.39
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <https://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <26420.61844.597011.839900@ixdm.fritz.box>
X-Mailman-Original-References <87v7wt986z.fsf@zedat.fu-berlin.de> <CAPTjJmoJErFTE-oS2X_Z+2yC6bMXvHZi0=CxkGhWnVtd4Gacvw@mail.gmail.com> <mailman.96.1731374262.4695.python-list@python.org> <87h68cyggb.fsf@zedat.fu-berlin.de>
Xref csiph.com comp.lang.python:197015

Show key headers only | View raw


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).

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

FileNotFoundError thrown due to file name in file, rather than file itself "Loris Bennett" <loris.bennett@fu-berlin.de> - 2024-11-11 15:05 +0100
  Re: FileNotFoundError thrown due to file name in file, rather than file itself Left Right <olegsivokon@gmail.com> - 2024-11-11 17:04 +0100
    Re: FileNotFoundError thrown due to file name in file, rather than file itself "Loris Bennett" <loris.bennett@fu-berlin.de> - 2024-11-12 10:15 +0100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Left Right <olegsivokon@gmail.com> - 2024-11-12 20:10 +0100
        Re: FileNotFoundError thrown due to file name in file, rather than file itself Greg Ewing <greg.ewing@canterbury.ac.nz> - 2024-11-13 14:04 +1300
          Re: FileNotFoundError thrown due to (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-11-13 02:13 +0000
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Mats Wichmann <mats@wichmann.us> - 2024-11-12 13:28 -0700
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Chris Angelico <rosuav@gmail.com> - 2024-11-13 07:34 +1100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself "Loris Bennett" <loris.bennett@fu-berlin.de> - 2024-11-13 08:11 +0100
        Re: FileNotFoundError thrown due to file name in file, rather than file itself Barry <barry@barrys-emacs.org> - 2024-11-14 16:01 +0000
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Roel Schroeven <roel@roelschroeven.net> - 2024-11-13 10:12 +0100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Michael Torrie <torriem@gmail.com> - 2024-11-13 21:07 -0700
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Left Right <olegsivokon@gmail.com> - 2024-11-14 08:03 +0100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Chris Angelico <rosuav@gmail.com> - 2024-11-14 19:13 +1100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself D'Arcy Cain <darcy@VybeNetworks.com> - 2024-11-13 06:37 -0700
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Ethan Furman <ethan@stoneleaf.us> - 2024-11-14 09:32 -0800
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Michael Torrie <torriem@gmail.com> - 2024-11-14 08:44 -0700
        Re: FileNotFoundError thrown due to file name in file, rather than file itself Jon Ribbens <jon+usenet@unequivocal.eu> - 2024-11-14 18:12 +0000
  Re: FileNotFoundError thrown due to file name in file, rather than file itself dieter.maurer@online.de - 2024-11-11 18:24 +0100
  Re: FileNotFoundError thrown due to (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-11-11 21:05 +0000
  Re: FileNotFoundError thrown due to file name in file, rather than file itself Chris Angelico <rosuav@gmail.com> - 2024-11-12 12:17 +1100
    Re: FileNotFoundError thrown due to file name in file, rather than file itself "Loris Bennett" <loris.bennett@fu-berlin.de> - 2024-11-12 10:00 +0100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself dieter.maurer@online.de - 2024-11-13 19:36 +0100
      Re: FileNotFoundError thrown due to file name in file, rather than file itself Kushal Kumaran <kushal@locationd.net> - 2024-11-13 14:40 -0800
    Re: FileNotFoundError thrown due to file name in file, rather than file itself "Loris Bennett" <loris.bennett@fu-berlin.de> - 2024-11-12 10:03 +0100

csiph-web