Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You need tender loving care once a week - so that I can slap you into shape. -- Ellyn Mustard


devel / comp.lang.python / Re: pathlib.Path.is_file vs os.path.isfile difference

SubjectAuthor
o Re: pathlib.Path.is_file vs os.path.isfile differenceThomas Passin

1
Re: pathlib.Path.is_file vs os.path.isfile difference

<mailman.67.1709922959.3452.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=29621&group=comp.lang.python#29621

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: list1@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: pathlib.Path.is_file vs os.path.isfile difference
Date: Fri, 8 Mar 2024 13:35:47 -0500
Lines: 19
Message-ID: <mailman.67.1709922959.3452.python-list@python.org>
References: <DB9PR10MB6689EA455D5C8580B90EA8F383272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM>
<33cad416-6f2d-4e1e-9c86-227e30e220fd@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Cf3CFxbUOTvWOBr4bi+EYwf4BZWmwdJlhpLMUC6fOLIg==
Cancel-Lock: sha1:TpuhxrnjbiUmUdRLeBtOWa3frPU= sha256:CvFxFyYaEqRrWjQnC+9f61u38Bv66GRG1Y2POOVfQTc=
Return-Path: <list1@tompassin.net>
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=tompassin.net header.i=@tompassin.net header.b=fqn9Ptbi;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.025
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'this:': 0.03; 'python.':
0.08; 'resemble': 0.09; 'exception.': 0.16; 'false.': 0.16;
'possible?': 0.16; 'received:10.0.0': 0.16; 'received:64.90':
0.16; 'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
'received:dreamhost.com': 0.16; 'subject:skip:o 10': 0.16;
'subject:skip:p 20': 0.16; 'wrote:': 0.16; 'python': 0.16; 'pm,':
0.19; 'to:addr:python-list': 0.20; 'returns': 0.22; 'version':
0.23; 'stuff': 0.25; 'old': 0.27; 'header:User-Agent:1': 0.30;
'python-list': 0.32; 'received:10.0': 0.32;
'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'unexpected': 0.32;
"i'm": 0.33; 'path': 0.33; 'header:In-Reply-To:1': 0.34;
'running': 0.34; 'errors': 0.36; 'file': 0.38; 'try': 0.40;
'skip:o 10': 0.61; 'true': 0.63; 'header:Received:6': 0.67;
'received:64': 0.67; 'discovered': 0.80; 'returned': 0.81;
'points': 0.84; '(such': 0.84; 'pointing': 0.84; 'exists': 0.91;
'replacing': 0.91
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1709922948; a=rsa-sha256;
cv=none;
b=74qB7RGtr5fNK4S4aWnLw1m+c0E2miiv69LRS/bxUC88SjZeYEOyrPhf/yc3tpiqzwACoA
3zjyc/x/eszyT4qkU+kj/H8R8806k1d7Qa8/NBSElDcdh03MPrtaCoLjGGqhW3anW3Hxor
3zfEqxpLxKz97rCdKU7uA2+GR5rN0DkMRylOzKq91bPqRVBH1tnWvSnEXQy9UnSv7cAXjn
t7Ytrlon68owzSM9EDXp6PKs1EfARxa5/cpRMH5vgHlOtYhnOVnuk5hgxkXjHNoCPSN/gH
VpJzAgaftjSU+7vzUTiQ+F5Vz1ouh1yPoKWj8MmIFsh06myvjE9K8Ha4w/NAPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1709922948;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=LHgTibmZWwffOukdimyRj5h+U4U4YijjIp7LIkQ5ZIs=;
b=7yT93Wq3s0SFGL0sidj8eARQDE0JcPFiJ2UuLVenoA2H4V1FHh2EwnWcqF9m7wdaR8hRQH
NMjnQkPZa25l4jo3EKT3gTiS/2Tk7O/smP+VgEZzv/6h8iS3rOJ5EJn3U+ldAQQri/HF+J
4SPpFq/pkp1RddswHmJHO+bseejT55GdVwrK66Rngh1WGkq7tkwnPyFoFfiQbQAJO687an
7d3X1niWsDRJEUMdn+b03PHGEaK6C1HEv5pqRCeHX98Sj9qAuJTKQ96Br1gWEg3CkKqMRU
ASdrOsZ0bQqUDQ1s0h0+VcBA0n9cvJBT/qFBn1qPoXfsy46KBhSydDOQgVAjQw==
ARC-Authentication-Results: i=1; rspamd-67fb46fddd-hdkwg;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Lettuce-Society: 1906c4e24835d91a_1709922948378_307643850
X-MC-Loop-Signature: 1709922948378:4003784785
X-MC-Ingress-Time: 1709922948377
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1709922947;
bh=LHgTibmZWwffOukdimyRj5h+U4U4YijjIp7LIkQ5ZIs=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=fqn9PtbiJ6Iw9/NmbFm1IWJs4NvxPekqGPKhXUw8KHC7YlwyAP0g8bt6RwTPcO6UF
af5Od9bv7t30Y9wCgWWyrZys7hpIhzZzrfV/SZI2pNwQMIePJwyCvukf8RsWXiEnqX
SU8SNGJ1PSAjKMIyNoYPkzranWYZ5T5C0EnL46KMl1SLvG6q8/iyxxOrL3JEJ0Kzgo
k7frMvaTzEntf1qYPfHhHcc4KpdZD2WQSQa1Wdsby23hfgvtQP7bHGdm3SYo5YFCo9
72Zn4DINGbNBAC97ZYJtf4PnqirJi4LLeRyRrFgcl4JLMWxAw0qZ1YLrhOo5zgbJAj
PH8GrZFyoS4xA==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <DB9PR10MB6689EA455D5C8580B90EA8F383272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.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: <33cad416-6f2d-4e1e-9c86-227e30e220fd@tompassin.net>
X-Mailman-Original-References: <DB9PR10MB6689EA455D5C8580B90EA8F383272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM>
 by: Thomas Passin - Fri, 8 Mar 2024 18:35 UTC

On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote:
> Hi,
> I was replacing some os.path stuff with Pathlib and I discovered this:
> Path(256 * "x").is_file() # OSError
> os.path.isfile(256 * "x") # bool
> Is this intended? Does pathlib try to resemble os.path as closely as
> possible?

You must have an very old version of Python. I'm running 3.12.2 and it
returns False. Either that or that path name exists and throws some
kind of unexpected exception.

The Python docs say

"Return True if the path points to a regular file (or a symbolic link
pointing to a regular file), False if it points to another kind of file.

False is also returned if the path doesn’t exist or is a broken symlink;
other errors (such as permission errors) are propagated"

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor