Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'sys': 0.05; 'shutil': 0.07; 'subject:file': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:# 20': 0.13; '"assert"': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:windows': 0.16; 'tmpdir': 0.16; 'tree': 0.18; 'software.': 0.22; 'sorry,': 0.22; 'import': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'skip:u 20': 0.30; '---': 0.30; 'checked': 0.31; 'file': 0.34; 'to:addr:python- list': 0.35; 'skip:o 20': 0.35; 'should': 0.37; 'subject:: ': 0.37; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'course': 0.64; 'antivirus': 0.66; 'received:nl': 0.72; 'avast': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Albert-Jan Roskam Subject: Re: windows and file names > 256 bytes Date: Fri, 26 Jun 2015 17:58:57 +0000 (UTC) References: <558BF55C.2010701@timgolden.me.uk> <558C038A.5010103@gmail.com> <558C0433.2050601@timgolden.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 82-170-182-209.ip.telfort.nl User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) X-Antivirus: avast! (VPS 150624-2, 06/24/2015), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1435341547 news.xs4all.nl 2900 [2001:888:2000:d::a6]:48621 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93203 > import os import shutil import sys > > # create an insanely long directory tree p = os.getenv("TEMP") > #p = ur"\\server\share\blah\temp" > tmpdir = p os.chdir(tmpdir) > for i in xrange(1000): > tmpdir = os.path.join(tmpdir, "sub") os.mkdir("\\\\?\\" + tmpdir) > #os.mkdir(u"\\\\?\\UNC" + tmpdir[1:]) > > # write a file to it deep = "\\\\?\\" + os.path.join(tmpdir, "deep.txt") > assert os.path.exists(deep) sorry, this "assert" should of course follow 'with open(..' --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus