Path: ...!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: References: <87v7wt986z.fsf@zedat.fu-berlin.de> <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: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <26420.61844.597011.839900@ixdm.fritz.box> X-Mailman-Original-References: <87v7wt986z.fsf@zedat.fu-berlin.de> <87h68cyggb.fsf@zedat.fu-berlin.de> Bytes: 5805 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).