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


Groups > comp.lang.python > #197017

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 Michael Torrie <torriem@gmail.com>
Newsgroups comp.lang.python
Subject Re: FileNotFoundError thrown due to file name in file, rather than file itself
Date Wed, 13 Nov 2024 21:07:56 -0700
Lines 14
Message-ID <mailman.107.1731557282.4695.python-list@python.org> (permalink)
References <87v7wt986z.fsf@zedat.fu-berlin.de> <CAJQBtg=UOiOmmHa25EUZtrZO19F1O0_VxCO6gWjZ5ebAMHnXCA@mail.gmail.com> <mailman.92.1731341107.4695.python-list@python.org> <875xosyfr0.fsf@zedat.fu-berlin.de> <CAJQBtg=nr+KC5iz_WY7nqkGK+YBEWAPq40ksaWJCAOT_+=pHxg@mail.gmail.com> <235f9d53-f784-8998-f201-1c01dbbf14ba@gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de sz5sV03LZXBaEBGYetHliw53jc+MXh9X2oqo8F6YEu4Q==
Cancel-Lock sha1:xZHzGoDFXqgaAA+5kqbVBO5TBVE= sha256:Wz7VgZMvtue5K1LpguOjIQo8XCJ+EPPqhvCMuLNurjg=
Return-Path <torriem@gmail.com>
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=gmail.com header.i=@gmail.com header.b=RNtThniD; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status OK 0.109
X-Spam-Level *
X-Spam-Evidence '*H*': 0.79; '*S*': 0.01; 'subject:name': 0.07; 'received:mail-pg1-x52c.google.com': 0.09; 'log': 0.12; 'impossible': 0.16; 'logs': 0.16; 'simple:': 0.16; 'windows.': 0.16; 'wrote:': 0.16; 'message-id:@gmail.com': 0.18; 'pm,': 0.19; 'to:addr:python-list': 0.20; 'written': 0.22; 'subject:file': 0.22; 'past': 0.25; 'header:User-Agent:1': 0.30; 'python-list': 0.32; 'signal': 0.32; 'but': 0.32; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34; 'from:addr:gmail.com': 0.34; 'one.': 0.35; 'close': 0.35; "it's": 0.37; 'received:192.168': 0.37; 'file': 0.38; 'quite': 0.39; 'handle': 0.39; 'happen': 0.40; "there's": 0.61; 'send': 0.62; 'simply': 0.63; 'right': 0.68; 'during': 0.69; 'chance': 0.71; 'left': 0.83; 'rotating': 0.84; 'subject: \n ': 0.84; 'reliable.': 0.91; 'subject:than': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731557279; x=1732162079; darn=python.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+hWQaPinlloV01tJY2h1GhNJLvCff/UZbq3+hNkHPsg=; b=RNtThniDzivB75eTEtNf6i1UEh+el2XELe19CagZ4ypfN2qHGPEMdyOwA0YTYk3Mje TKzVEKIUxHC/gUidgUybicnsSjopkFNSEWjzdSlka460rM6f5XTaw+ZAy38bWNfz2LyJ Ob4T7FMK8uaRxe/z7ClzAfQTi02vuZlkyT1O1UpYwBPDtQgj1gjhw1aRgH0GSpxNBEt/ 6nW0F9Vo1GVEMPb4aNInhwFVSjCbBnxI/lYhNQXwbDk83olB/kBXNrYq59JzxLscgfYC LYiaCUzfpxtqhbkAt9dYjBRE4PH65c3ipf6O2wmq2zvTL0olHaJjdU9/PHtrX1PQFyQt Rdmg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731557279; x=1732162079; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+hWQaPinlloV01tJY2h1GhNJLvCff/UZbq3+hNkHPsg=; b=WKEEB4U3fSCZhq28Qxd3WqI/ydFyV06VgM5E4KYTVxd3cCWGHd8kQiue0mP27YrLw1 facUYBZYGczu9jUWJg6P0/Az6iR0Kv0dGkUskS0pDKGwgqvrwQVIbZzl7nQgoqW8E9DL R4JMav+S3xalyTKds+a16iYfEeLlPh29DtLg+R+rXYN6+YjsP0P4aXuA4YvH1iNWdSTk 7IQzCVSJQFPf08XR0Heb4umpggjTF8u0KxdbXnHlMWZ2zoYYWRh+zq5GhV9OWAG3MUI8 u9kucL3T3ILRvIkqoEUtCvMArcRzbwVQR/Un2bo+i6c+domz7U6Nvwj/qMm7pmwcCxbx r8bw==
X-Gm-Message-State AOJu0Ywn7w41yv64hchxha+tQU0Wmi45oPkFIWyuUzWfhpxhWtvuY2Np V3bLheJtlC6avGHPBy0BA6xsG6SJko7xalNr2op8L/CCXIUt2m+Ky18IsN9D4lg=
X-Google-Smtp-Source AGHT+IGKQ2aO/anLbdk1zzHbC+HkP1zLoMhudOJPn6G5ytpHFaFMnYb6AYav6eyFC5MZLB3zh5Wj7w==
X-Received by 2002:a05:6a20:3d86:b0:1d9:ddf:b092 with SMTP id adf61e73a8af0-1dc22b360f0mr14103156637.11.1731557278819; Wed, 13 Nov 2024 20:07:58 -0800 (PST)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1
Content-Language en-US
In-Reply-To <CAJQBtg=nr+KC5iz_WY7nqkGK+YBEWAPq40ksaWJCAOT_+=pHxg@mail.gmail.com>
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 <235f9d53-f784-8998-f201-1c01dbbf14ba@gmail.com>
X-Mailman-Original-References <87v7wt986z.fsf@zedat.fu-berlin.de> <CAJQBtg=UOiOmmHa25EUZtrZO19F1O0_VxCO6gWjZ5ebAMHnXCA@mail.gmail.com> <mailman.92.1731341107.4695.python-list@python.org> <875xosyfr0.fsf@zedat.fu-berlin.de> <CAJQBtg=nr+KC5iz_WY7nqkGK+YBEWAPq40ksaWJCAOT_+=pHxg@mail.gmail.com>
Xref csiph.com comp.lang.python:197017

Show key headers only | View raw


On 11/12/24 12:10 PM, Left Right via Python-list wrote:
> But, it's
> impossible to reliably rotate a log file.  There's always a chance
> that during the rotation some log entries will be written to the file
> past the point of rotation, but prior to the point where the next logs
> volume starts.

On any Unix system this is untrue.  Rotating a log file is quite simple:
simply rename the log file, then send a signal to the process to close
the log file handle and open a new one.  After that perhaps compress the
rotated log file.  Nothing is lost.  This is standard practice in Unix.
It is reliable.

Perhaps the scenario you posit would happen on Windows.

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


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