Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Many pages make a thick book, except for pocket Bibles which are on very very thin paper.


comp / comp.lang.python / Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment

SubjectAuthor
o Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environmentLeft Right

1
Subject: Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment
From: Left Right
Newsgroups: comp.lang.python
Date: Thu, 24 Oct 2024 16:30 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder2.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: olegsivokon@gmail.com (Left Right)
Newsgroups: comp.lang.python
Subject: Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment
Date: Thu, 24 Oct 2024 18:30:21 +0200
Lines: 19
Message-ID: <mailman.38.1729790012.4695.python-list@python.org>
References: <4a13731716200669342338ae409e73ca@posteo.de>
<CAJQBtg=kCr0VMGXvkBcj4U6CwatC2_G2dstO5pS56_koAXJurA@mail.gmail.com>
<0c080a7d-92de-4518-ac44-78d97fc9e3bb@mrabarnett.plus.com>
<CAJQBtg=ButLwvoA2USBEV8-q=taRhuC+t6D1HkJMbG9VzTvxnQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 3MvI+O85HgAIg8ASGUDiLQH2qkKRBjt5pRlq4rrq9oxQ==
Cancel-Lock: sha1:UusmKcPpts0yiLz/d0Hft2OdQcY= sha256:mEIHSyVW+3kDNFHJY4X5+NphEwp+LVWjDszZ8qdoxyU=
Return-Path: <olegsivokon@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=UrQJFZQ1;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(which': 0.04;
'subject:when': 0.07; 'cc:addr:python-list': 0.09; 'mechanism':
0.09; 'cc:no real name:2**0': 0.14; 'import': 0.15; 'memory':
0.15; '651': 0.16; '677': 0.16; '679': 0.16; '689': 0.16; '760':
0.16; 'appended': 0.16; 'executed': 0.16; 'interpreter': 0.16;
'received:mail-ot1-x336.google.com': 0.16; 'subject:() ': 0.16;
'subject:Fedora': 0.16; 'subject:fails': 0.16; 'subject:used':
0.16; 'times,': 0.16; 'problem': 0.16; "can't": 0.17;
'cc:addr:python.org': 0.20; 'problem,': 0.22; 'lines': 0.23;
'code': 0.23; 'cc:2**0': 0.25; "isn't": 0.27; 'else': 0.27;
'function': 0.27; 'module': 0.31; 'message-id:@mail.gmail.com':
0.31; "doesn't": 0.32; "wouldn't": 0.32; 'but': 0.32; 'there':
0.33; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'same': 0.34; 'from:addr:gmail.com': 0.34; 'trying': 0.35;
'following': 0.35; 'functions': 0.36; 'those': 0.36; 'put': 0.38;
'two': 0.39; 'explain': 0.40; 'something': 0.40; 'once': 0.63;
'compare': 0.69; 'forcing': 0.69; 'times': 0.69; 'them,': 0.70
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1729787433; x=1730392233; darn=python.org;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=nX6R+Qi481BpJ5o5h/gRuhhENVkRn9gAUTiQk8XTCco=;
b=UrQJFZQ10XFbs8LEAnscZR9u6nraVGNWQ+H0khIxDovJrJpdJ0JdlKi+ACGSZiko6F
nKgSKNQTIqT4LqdTAbepgflqHfagpDxNU9Z3WN1VzgIHwijtsHSksPXed+mRT2ZoaxT6
Ro6OHVlfKV2P/ByqsfkBUYhBbJG6wLFJ08NahbO2bVw5xcAjUI514TDm9g+sLS1Lo8Yq
HwsN61uEda/QJvwkCYjXgACHw4v3L/ffC50pVeB61aI8SlpsXBLKdFruSzallNGS+8qf
lkDO/qs478dojuCwD2m1hwJJU59zVewKlRZpzN2IOfjUS46zIlBMCxCGCv5ziHLu2Ym1
JW1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1729787433; x=1730392233;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=nX6R+Qi481BpJ5o5h/gRuhhENVkRn9gAUTiQk8XTCco=;
b=uQWsQMyveBUkWbZfBicop0ViNF2Z3YXaH333japP2/OKF5voiZNx0JA3tRf7PxpTC9
b+PV7+cdOZ9waPyUQSz+XphAdE+16gCKnkBkI6NMdzkObFGjMEzKmsZppNO1iPotIYk2
DqJA//hn2+aRBzOVXqM0KqXLWWazwujVqXLW7fo9ihsI6pG7zG6R2/6oQ+fDArNWnaty
i0xvTulitG+t2bUFid/RBargMFxxBLnNKh+2yrXlXPROzfIlA7Ts8Bc0TzOteGkdM4oP
lU4HlGVTW/Bzni9PFCVIbwoVq5mcVCipK+nigooYDzUNglQgwPmmfvhjyr2z7qXV1e+k
bm4w==
X-Gm-Message-State: AOJu0Yy/E8l6FJWrkpEgiSfhlJpR+SP+FSkf3s+/gRw1kbztg+eqiOxa
wpwcEkrJsYg0MlI6JgPHeJ3YB6a0kj0kvP/1zbcJo6edZUcrZkYekxMEKCBAxYWi69PKYPwlJEn
I3sRa7UXZtkDgOTLFy2TgMQpnNlex8w==
X-Google-Smtp-Source: AGHT+IF40lhB4aIO0bxXi2bL44QxYtZXpqCkO1Or/l84myi7pTE5aP6OF9TRuMg6e3kY6lZOCwUifZvbpcuMuCphdEs=
X-Received: by 2002:a05:6358:7f16:b0:1c3:94bf:643e with SMTP id
e5c5f4694b2df-1c3d8118f4dmr492905355d.16.1729787432861; Thu, 24 Oct 2024
09:30:32 -0700 (PDT)
In-Reply-To: <0c080a7d-92de-4518-ac44-78d97fc9e3bb@mrabarnett.plus.com>
X-Mailman-Approved-At: Thu, 24 Oct 2024 13:13:30 -0400
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: <CAJQBtg=ButLwvoA2USBEV8-q=taRhuC+t6D1HkJMbG9VzTvxnQ@mail.gmail.com>
X-Mailman-Original-References: <4a13731716200669342338ae409e73ca@posteo.de>
<CAJQBtg=kCr0VMGXvkBcj4U6CwatC2_G2dstO5pS56_koAXJurA@mail.gmail.com>
<0c080a7d-92de-4518-ac44-78d97fc9e3bb@mrabarnett.plus.com>
View all headers

> The stack is created on line 760 with os.lstat and entries are appended
> on lines 677 (os.rmdir), 679 (os.close) and 689 (os.lstat).
>
> 'func' is popped off the stack on line 651 and check in the following lines.
>
> I can't see anywhere else where something else is put onto the stack or
> an entry is replaced.

But how do you know this code isn't executed from different threads?
What I anticipate to be the problem is that the "os" module is
imported twice, and there are two references to "os.lstat". Normally,
this wouldn't cause a problem, because they are the same function that
doesn't have any state, but once you are trying to compare them, the
identity test will fail, because those functions were loaded multiple
times into different memory locations.

I don't know of any specific mechanism for forcing the interpreter to
import the same module multiple times, but if that was possible (which
in principle it is), then it would explain the behavior.

1

rocksolid light 0.9.8
clearnet tor