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


Groups > comp.lang.python > #93129

Re: windows and file names > 256 bytes

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'paths': 0.05; 'prefix': 0.07; 'subject:file': 0.07; '(those': 0.09; 'bug': 0.10; 'cc:addr :python-list': 0.10; 'python': 0.11; 'syntax': 0.13; 'thu,': 0.15; '"."': 0.16; 'expecting': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'length:': 0.16; 'message- id:@timgolden.me.uk': 0.16; 'paths.': 0.16; 'prepend': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'silly': 0.16; 'something.': 0.16; 'somewhere.': 0.16; 'subject:windows': 0.16; 'tjg': 0.16; 'wrote:': 0.16; 'first.': 0.18; 'mechanism': 0.18; 'python?': 0.18; '>>>': 0.20; 'windows': 0.20; 'tracker': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'parsing': 0.22; '2015': 0.23; 'passing': 0.23; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'chris': 0.26; "doesn't": 0.28; 'regular': 0.29; 'behaviour': 0.29; 'allows': 0.30; 'relative': 0.31; "i'd": 0.31; 'extend': 0.31; 'certain': 0.31; "d'aprano": 0.33; 'received:192.168.100': 0.33; 'steven': 0.33; 'file': 0.34; 'could': 0.35; 'path': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'subject:: ': 0.37; 'starting': 0.38; 'names': 0.38; 'say': 0.38; 'pm,': 0.39; 'enough': 0.39; 'received:192': 0.39; 'further': 0.60; 'simple': 0.61; 'times': 0.61; 'details': 0.63; 'charset:windows-1252': 0.65; 'from:addr:mail': 0.70; 'handing': 0.84; 'imagine,': 0.84; 'to:none': 0.90; 'dealt': 0.91
Subject Re: windows and file names > 256 bytes
References <mailman.44.1435219506.3674.python-list@python.org> <558bc6f1$0$11104$c3e8da3@news.astraweb.com> <CAPTjJmqOK63ifOPJXio4s25J6buxuoFFamFgZrMzpWJDGKSV1A@mail.gmail.com>
Cc "python-list@python.org" <python-list@python.org>
From Tim Golden <mail@timgolden.me.uk>
Date Thu, 25 Jun 2015 11:10:14 +0100
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1
MIME-Version 1.0
In-Reply-To <CAPTjJmqOK63ifOPJXio4s25J6buxuoFFamFgZrMzpWJDGKSV1A@mail.gmail.com>
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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 <http://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>
Newsgroups comp.lang.python
Message-ID <mailman.54.1435227018.3674.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1435227018 news.xs4all.nl 2893 [2001:888:2000:d::a6]:54530
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 4676
X-Received-Body-CRC 97923885
Xref csiph.com comp.lang.python:93129

Show key headers only | View raw


On 25/06/2015 10:23, Chris Angelico wrote:
> On Thu, Jun 25, 2015 at 7:16 PM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> wrote:
>>> 2. Is this a bug in Python? I would prefer if Python dealt with the gory
>>> details of Windows' silly behavior.
>>
>> I would say that it is a bug that it doesn't work with extended-length paths
>> (those starting with \\?\) but may or may not be a bug with regular paths.
> 
> I'd go further and say that the OP is right in expecting Python to
> deal with the gory details. Would it break anything for Python to
> prepend \\?\ to all file names before giving them to certain APIs?
> Then the current behaviour of stripping off that prefix would be fine.
> 
> Are there any times when you *don't* want Windows to use the
> extended-length path?

Yes: when you're passing a relative filepath. Which could pretty much be
any time. As you might imagine, this has come up before -- there's an
issue on the tracker for it somewhere. I just don't think it's simple
enough for Python to know when and when not to use the extended path
syntax without danger of breaking something.

Bear in mind that the \\?\ prefix doesn't just extend the length: it
also allows otherwise special-cased characters such as "." or "..". It's
a general-purpose mechanism for handing something straight to the file
system without parsing it first.

TJG

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


Thread

windows and file names > 256 bytes Albert-Jan Roskam <sjeik_appie@hotmail.com> - 2015-06-25 08:00 +0000
  Re: windows and file names > 256 bytes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-25 19:16 +1000
    Re: windows and file names > 256 bytes Chris Angelico <rosuav@gmail.com> - 2015-06-25 19:23 +1000
    Re: windows and file names > 256 bytes Tim Golden <mail@timgolden.me.uk> - 2015-06-25 11:10 +0100
    Re: windows and file names > 256 bytes Chris Angelico <rosuav@gmail.com> - 2015-06-25 20:23 +1000
    Re: windows and file names > 256 bytes Terry Reedy <tjreedy@udel.edu> - 2015-06-25 13:03 -0400

csiph-web