Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!feeder.news-service.com!multikabel.net!newsfeed10.multikabel.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '>>>>': 0.09; 'received:188.220': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'skip:o 50': 0.09; '"hide': 0.16; 'return.': 0.16; 'subject:named': 0.16; 'extensions': 0.16; 'exists.': 0.19; 'switched': 0.19; 'wrote': 0.21; 'subject:not': 0.21; 'file,': 0.22; 'maybe': 0.22; 'windows': 0.26; 'exist.': 0.30; 'shows': 0.32; "skip:' 10": 0.32; 'explorer': 0.32; 'does': 0.32; 'anyone': 0.33; 'to:addr:python-list': 0.34; 'header:X -Complaints-To:1': 0.34; 'header:User-Agent:1': 0.34; 'on,': 0.34; 'example,': 0.35; 'directory.': 0.35; "isn't": 0.35; 'folder': 0.35; 'skip:" 10': 0.36; 'file': 0.36; 'but': 0.37; 'could': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'case': 0.39; 'to:addr:python.org': 0.39; 'received:188': 0.69; 'why?': 0.73; 'received:bethere.co.uk': 0.84; 'subject:skip:o 10': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Rob Williscroft Subject: Re: os.path.isdir do not work for Foder named '2011-07-03' Date: Tue, 19 Jul 2011 04:56:59 +0000 (UTC) References: <0bf400a3-735c-487a-8d74-feb3b56be99b@g5g2000prn.googlegroups.com> X-Gmane-NNTP-Posting-Host: 188-220-43-229.zone11.bethere.co.uk User-Agent: Xnews/5.04.25 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311051439 news.xs4all.nl 23890 [2001:888:2000:d::a6]:53952 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9852 Nulpum wrote in news:0bf400a3-735c-487a-8d74- feb3b56be99b@g5g2000prn.googlegroups.com in gmane.comp.python.general: > I want to make sure that folder exists. > '2011-07-03' is really exists. but 'os.path.isdir' say false > Does anyone know why? > >>>> os.path.isdir("C:\Users\Á¶Ã¢ÁØ\Desktop\logs") > True >>>> os.path.isdir("C:\Users\Á¶Ã¢ÁØ\Desktop\logs\2011-07-03") > False Maybe it isn't a directory, but a file, what does os.path.exists() return. Also could it be a "Shortcut" in which case 2011-07-03.lnk will exist. Also have you left "Hide extensions for known file types" switched on, in which case it may really be "2011-07-03.zip" for example, a file not a directory even though Windows explorer shows it as a directory. -- Rob.