Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Life's the same, except for the shoes. -- The Cars


devel / comp.lang.python / Re: pathlib.Path.is_file vs os.path.isfile difference (Posting On Python-List Prohibited)

SubjectAuthor
* pathlib.Path.is_file vs os.path.isfile differenceAlbert-Jan Roskam
+- Re: pathlib.Path.is_file vs os.path.isfile differenceStefan Ram
`* Re: pathlib.Path.is_file vs os.path.isfile differenceStefan Ram
 `- Re: pathlib.Path.is_file vs os.path.isfile difference (Posting On Python-List PrLawrence D'Oliveiro

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: sjeik_appie@hotmail.com (Albert-Jan Roskam)
Newsgroups: comp.lang.python
Subject: pathlib.Path.is_file vs os.path.isfile difference
Date: Fri, 08 Mar 2024 19:03:40 +0100
Lines: 8
Message-ID: <mailman.66.1709921032.3452.python-list@python.org>
References: <DB9PR10MB6689EA455D5C8580B90EA8F383272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
X-Trace: news.uni-berlin.de EEVd4lwd5w5lycwLepGuzgCj6/JwNK5G0uUKNBvBRu4g==
Cancel-Lock: sha1:nKKgws3SwEn1xFlYOeFhc+rtKKE= sha256:hlJYluudjrl9mjXbDcUn7iFyauPMVleKaLxVAFnyxW8=
Return-Path: <sjeik_appie@hotmail.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=hotmail.com header.i=@hotmail.com header.b=Oyyw76A/;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.093
X-Spam-Evidence: '*H*': 0.90; '*S*': 0.08; 'this:': 0.03; 'resemble':
0.09; 'possible?': 0.16; 'subject:skip:o 10': 0.16;
'subject:skip:p 20': 0.16; 'to:addr:python-list': 0.20; 'stuff':
0.25; 'try': 0.40; 'best': 0.61; 'skip:o 20': 0.63; 'discovered':
0.80; 'replacing': 0.91
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=kC3FxiPYUPRb0Thtgh8+idc6ujsDpVmf3YOq/JWdFA/UnqtTk8UQ73zLEb2NN5SSXYNwM18ERri5/9iEvRNLm2/bgf9ddjlzZTQTx8fcTICu8sdjGDpnN5xkiILi5mXBmJvwOkUflKoH9XsEZE5wtCjuFL0QYVf6EIcKIJdAB6DMlbRYuyab0ZZxg9a5BsH+ReKggBmvGikRFOkv0bxQvZ1qU9p4Wsad6p2tofnLlXjdLqPEel9lpxwSKnMw3cDHkaykPju66oGVlwk+ktcYgzblNKdRLA9sGahZwu0cQvFswDA6VhykOAdmohAbi23c4fTavfUWBxOE8F+XhltmmQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=YM0T28/oFi/bnI7PUqBv1GRtSm9abYthdbvCOwuDAPw=;
b=X8RcFMsf+IlqIFmYdfuFnk4Z2QEQeweWnO8G29tlfBEOfIpox/Wd6D3n8Q8o+6iNyVB+caV5y0pFVwYS6DG+St2DlEivtAan2w7FlWYXRjyaA+VqOf/WQ7INu661a2S4PCdZXK0sKOTrwmt758RFNAADw9JDJPrVhRp6v7RPjEE/r5ONwaciQZNEzaKy5NjH6o1FWYrg+q0CLxycfARzsE2f9Glb9I/og+uh5tmBwmhU3fEScJZb9/98Y8moUhGgMckihKllme2aaHQO25v0YpjYRwZ6edxQm2RWUOdfx+HdQvL6t+FNXiJIfmPXn24aLBFbfVZfm4qDRLKa71GGeQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=YM0T28/oFi/bnI7PUqBv1GRtSm9abYthdbvCOwuDAPw=;
b=Oyyw76A/u27BgtWcRKfJp06CyeZLvTiqFE3ZBW+koilBZpotRcGg16KtAKHfIptkHO5yT9M4WzsMLJG9Qdm1vzR23oXOQmKsWbgyBmfbK1tgVMs7uKuFAmna42qq0ergM6YMxt6hGJNgXOxxVXLO/IB+QhjQIQZKuimL7EYHRgbjPSZLdNCx0Tkwz8KxjvbjtsvcHsfpXA8YEMv1cO/hF1yMhVILsYFSb11kzszufa/n75sG624hWWWmGv0wa0cjoK3dLZnDsXXXeq4gg6jh+78pEPrYNEoKJp/PzDhmoSNP0X5JSLz2AH5Zn3MkCAYNojUfZe9PWIxLDhF++YrSUQ==
X-Android-Message-ID: <6b66f1cf-9a04-456c-96d5-6c2948355420@email.android.com>
X-TMN: [ITnrNjdAzZyVaR4fVXgTNDf4a6CRXTkU]
X-ClientProxiedBy: AS4P190CA0063.EURP190.PROD.OUTLOOK.COM
(2603:10a6:20b:656::14) To DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM
(2603:10a6:10:3d3::21)
X-Microsoft-Original-Message-ID: <6b66f1cf-9a04-456c-96d5-6c2948355420@email.android.com>
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DB9PR10MB6689:EE_|AM9PR10MB3990:EE_
X-MS-Office365-Filtering-Correlation-Id: 2b7415b2-e4de-4255-d1c4-08dc3f9a177a
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: pvnAWSfoQTTNHCJLAf6zPdxz6lcfoW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II+
y8hqHyIP0vtaVk4r6UwbVcg1IxVLrA9T09oG/gW2+f6Qu
t0tiBd+wGRTAETIH41ZVu6AXE93gJ1M5fVZsjzxsU1DcY
342L0W3fk2jAvC4yIALQYGgsDp740rbmDg8lhkRZciz4T
GTxcSPL20rmtW79evku6kqSzt6+qRbI3xreD8u8q7zWas
ut+zapStkEunMNTEg9oFfW0NOO7kxECkBPQJBnWSZpAYJ
JJB4peDMUM2yGW6OO+S7f2+gyGRRbksYOq/Pm0Ti/KbiF
YqiJaWs5ycXZcU4hvAza/jBLm3ei54QVSTZCXcHAH5neV
uL7/08J7suDhqi0kzhp5ZBtQsKH+k9kZLOPxchlyiXfX5
0KSt7dqEUiXQxRkTGU1GPiK6NYJW4B9XTpoFJVVXo9KWw
8XBhxuH2yaTYeOBgPx0lh5YtChR1Anbsb4wKHzErwtGt+
yahXLklhj6UsAKeQg+9/RuNLGaVvIqH6AFYhwTeysKk8f
axCYqyXZqnrv7gpb+4Ts03+4qdKhslvJwUXi6xqZlm3YA
XoNco5CmkMoAJdoygTFwakONTdXta+lyLXQIDYtlpR/xX
UVErd9KtjZ8GUHtlhchRuf7CTVXqwUs336WH34kXbqLGc
2ZvCySrqlgR/K2gtnvmwPIF7Wdx3/5n/i4GPNWP9CKrAs
lwmueit5xlFUgVzAqePM53ZELNINLBaVrYSHwdCH/T8Sk
cuo4Zyvo6Q6ZJRrJ1yOzBtLtcbi+Ad5qGJLaJ3wnrkHph
t81WyPCdZLUcIv9DMvkQ7F9UeHgBN6L5xk1jPR4drXqE=
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant
X-MS-Exchange-CrossTenant-Network-Message-Id: 2b7415b2-e4de-4255-d1c4-08dc3f9a177a
X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 18:03:43.5238 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR10MB3990
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <DB9PR10MB6689EA455D5C8580B90EA8F383272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM>
 by: Albert-Jan Roskam - Fri, 8 Mar 2024 18:03 UTC

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?
Best wishes,
Albert-Jan

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

<pathlibg-20240308191110@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: pathlib.Path.is_file vs os.path.isfile difference
Date: 8 Mar 2024 18:19:04 GMT
Organization: Stefan Ram
Lines: 16
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <pathlibg-20240308191110@ram.dialup.fu-berlin.de>
References: <mailman.66.1709921032.3452.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de hZf7PKaL11hHHV68+LDDvAdS8Ctm56gbvHaJUr3PC4zSxm
Cancel-Lock: sha1:5LFUAkK2JRD14l8XnbBjtGKNzYs= sha256:ltr490MZo662i9XRQZnb5MgdcEc2RR/oei0ntJAMsJo=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Fri, 8 Mar 2024 18:19 UTC

Albert-Jan Roskam <sjeik_appie@hotmail.com> wrote or quoted:
>Path(256 * "x").is_file() # OSError
>os.path.isfile(256 * "x") # bool
>Is this intended?

When something is documented and behaves accordingly,
we assume it was intended.

>Does pathlib try to resemble os.path as closely as possible?

No.

The definition of "isfile" contains:

|except (OSError, ValueError):
| return False

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

<stuff-20240308193045@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: pathlib.Path.is_file vs os.path.isfile difference
Date: 8 Mar 2024 18:31:07 GMT
Organization: Stefan Ram
Lines: 4
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <stuff-20240308193045@ram.dialup.fu-berlin.de>
References: <mailman.66.1709921032.3452.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Fwht4MyP+4PQNcO3pbaFuAUNr6kll53chgIFU4HCFfcwZJ
Cancel-Lock: sha1:ncs9o6fKbwKO3UULxazPvdvMZLo= sha256:w0TocPqC6UHNIpZ3w3w+tY7NJzUkU7rXkHeDOIK/dVw=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Fri, 8 Mar 2024 18:31 UTC

Albert-Jan Roskam <sjeik_appie@hotmail.com> wrote or quoted:
>I was replacing some os.path stuff with Pathlib

Don't try to fix it if it ain't broke!

Re: pathlib.Path.is_file vs os.path.isfile difference (Posting On Python-List Prohibited)

<usfthn$1t89i$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: pathlib.Path.is_file vs os.path.isfile difference (Posting On
Python-List Prohibited)
Date: Fri, 8 Mar 2024 20:47:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <usfthn$1t89i$2@dont-email.me>
References: <mailman.66.1709921032.3452.python-list@python.org>
<stuff-20240308193045@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Mar 2024 20:47:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d5f167ea8e6b66fd37103ff38661b22f";
logging-data="2007346"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19d5kAI10a5c6VNhYtPXCt1"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ul8Q1+TjXDiYdLvWXgJlryR4ZrA=
 by: Lawrence D'Oliv - Fri, 8 Mar 2024 20:47 UTC

On 8 Mar 2024 18:31:07 GMT, Stefan Ram wrote:

> Albert-Jan Roskam <sjeik_appie@hotmail.com> wrote or quoted:
>
>>I was replacing some os.path stuff with Pathlib
>
> Don't try to fix it if it ain't broke!

I can’t see the point of pathlib. It just seems to be trying to paper over
the differences between Windows and *nix systems. Does anybody still care
about being compatible with native-Windows any more? After all, that’s
what WSL is for.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor