Deutsch English Français Italiano |
<mailman.74.1709939763.3452.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail From: Thomas Passin <list1@tompassin.net> Newsgroups: comp.lang.python Subject: Re: pathlib.Path.is_file vs os.path.isfile difference Date: Fri, 8 Mar 2024 17:57:57 -0500 Lines: 29 Message-ID: <mailman.74.1709939763.3452.python-list@python.org> References: <DB9PR10MB6689728A4E7F95E99F80B9F283272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM> <f2d7a7bc-af39-408d-9614-13d32f8cf0b4@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 ei8Aby03+3AppDp+96iw6gOhF0t80xObdooP94bJx/fw== Cancel-Lock: sha1:Awy7X0nNzYdPjojB9eqoh00LSjI= sha256:4Sl8E4I54bQ7xomPG66EmjGdeM/WScrPWXgT8kHM94E= 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=aTuIK0gx; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'this:': 0.03; 'mar': 0.07; 'resemble': 0.09; '2024': 0.16; '3.8.': 0.16; '====': 0.16; 'exception.': 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; 'windows.': 0.16; 'wrote:': 0.16; 'python': 0.16; 'pm,': 0.19; 'to:addr :python-list': 0.20; 'ran': 0.22; 'returns': 0.22; 'version': 0.23; 'to:name:python-list@python.org': 0.24; '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; 'posts': 0.36; 'try': 0.40; 'skip:o 10': 0.61; 'back': 0.67; 'header:Received:6': 0.67; 'received:64': 0.67; 'discovered': 0.80; '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=1709938677; a=rsa-sha256; cv=none; b=h++Pd7tL4QRbAY+nLR9RYsc6tpeJDwTSHn0cn/n+eKU1fmlzvL8i8n1jmDiZxfLyMkC31G z8Rei7QNrMREMZjOOvgR2ZeOus7+BFJe53+DfDAN3wFzEmG30vL4FsoMoYPOtTpPQkgrbi /0xkOmN3Zb7gPjCIkOJI9RAhJ24AHeTr++g1tvf1GwMirA46XDcEeoUkonzipuuJaB8vCH DKRf32BSD8HLRMYgRXEfmx3y4Ty921Fw4hm036g5mb/qaxhluKh0JD1rgQJ1lWiHucL3W1 y14KhpVOkv5rxtgiQ2VHk5d3hL76Nv4/Jdyvq/8bznCVLYsWR2EmhMEwUqYRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1709938677; 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=L5t4xjiTIFb8zAN04vPXq+oQlFR/t+GxbLJ+FfF04mE=; b=G+PkOrhmOVToNzqtQGNkvXeV2XDU5itaXTKBuov3z6VO76Go/8UAahPhQmwYkPi9kAiyYU DJMgrED8dwuOdy74uyb9cqBXqP/vid7dlOhY5+hVy7Lomv2ylFoj0PjesLihy6/z/bNJ09 fw9MjvIpkM2kQgX18EfWcJV6Uhe19atBmUdx5Dt+6u3+3uvIRQfXzyd0MRWjykTisIG/Ry L8H7ZYf09QHMXyMXFsxtGT1jF6IzystR+GMZgX6qQXIKHoSuz7R1FDSeePZ/70KdIWdgQ9 7ZgDc3NFADQL41F0XxHwhcUB7L0zZNRdnuhjE3AV98oQH2BXpYD1w2mqM9BBxg== ARC-Authentication-Results: i=1; rspamd-67fb46fddd-kmqh5; 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-Bubble-Print: 2d7e8b8c69a5f5b6_1709938678007_1984656386 X-MC-Loop-Signature: 1709938678007:1416358089 X-MC-Ingress-Time: 1709938678007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net; s=dreamhost; t=1709938677; bh=L5t4xjiTIFb8zAN04vPXq+oQlFR/t+GxbLJ+FfF04mE=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=aTuIK0gxfL40XIsv1NCGY4Ginxp5zXeNygBT8aERxa5XnnmvonwkyhPK0wwJmCezQ xFp8JyU0KVzaWTDmUEb5C69ptwxzg8jOnkUlMnRO5QeSiR2qfX1djCBiy6YymLuk4s kVmerDuTJY6i4wqjBezMj3Wiadpa2HKuiPw8y5cOHwGgCzfJgj8BkF2j5YNLeTjbLr 8ChfFjVngr9cd3wkWtDiGtNvmmu9mcipMlHdBKmYigjqNke5F/XjR3vz4VXR2J3tWB iMznKlc7LyPBDCQ+F7ChifJq2whu6pG9UIYZTweycAebAUwWRD2asd7SqdLkt9saSe 9pf18RoFbYcww== User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: <DB9PR10MB6689728A4E7F95E99F80B9F283272@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: <f2d7a7bc-af39-408d-9614-13d32f8cf0b4@tompassin.net> X-Mailman-Original-References: <DB9PR10MB6689728A4E7F95E99F80B9F283272@DB9PR10MB6689.EURPRD10.PROD.OUTLOOK.COM> Bytes: 6375 On 3/8/2024 5:14 PM, Albert-Jan Roskam wrote: > > > On Mar 8, 2024 19:35, Thomas Passin via Python-list > <python-list@python.org> wrote: > > 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. > > > > ==== > > Hi, I tested this with Python 3.8. Good to know that this was fixed! We just learned a few posts back that it might be specific to Linux; I ran it on Windows.