Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'attribute': 0.05; 'completeness': 0.07; 'constructor': 0.07; 'received:155': 0.09; 'subject:ignore': 0.09; 'tuple': 0.09; 'ignore': 0.13; 'passing': 0.15; "'replace'": 0.16; '46,': 0.16; '49,': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'subject:fails': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'skip:i 40': 0.17; 'skip:+ 20': 0.18; '>>>': 0.18; 'to:name:python-list@python.org': 0.20; '"",': 0.22; 'work.': 0.23; 'received:169.254': 0.24; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; '(most': 0.27; 'accuracy': 0.27; 'this?': 0.28; 'convert': 0.29; 'received:169': 0.29; 'skip:_ 10': 0.29; "skip:' 10": 0.30; 'file': 0.32; "skip:' 20": 0.32; 'skip:s 30': 0.33; 'traceback': 0.33; 'to:addr:python- list': 0.33; 'fail': 0.35; 'filter': 0.35; 'subject:?': 0.35; 'there': 0.35; 'but': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'skip:p 20': 0.36; 'does': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'think': 0.40; 'solve': 0.62; 'information,': 0.63; 'url:email': 0.63; 'legal': 0.65; 'subject': 0.66; 'purchase': 0.67; 'sale': 0.76; '138,': 0.84; 'received:169.254.8': 0.84 X-DKIM: OpenDKIM Filter v2.1.3 sj1.jpmchase.com q6JGr7Qq008456 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1342716787; bh=vUtpJUzW702LYopkDxJq22/9SZKum6Iu7o5Ae1yzJUg=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=Vt5o5BAeSvV9PfkU11dxg0+ZfqUrvBdhDHINwmmrfPFnMHN7Ybrb5QKc7DvJX86sJ 8NHXyQjda4WXoaOjZfjVtG8iNXn4isJW+fSe9IsS5vlBxIigFbHe/stJ48c7+m+2Uf 3ZyQefUhmty/YnpzWfgNgPnuSwf+MvlsRDDCIy2c= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: shutil ignore fails on passing a tuple? Thread-Topic: shutil ignore fails on passing a tuple? Thread-Index: AQHNZc32XlR15Lpjuki83oCb8oZtkZcw0d/A Date: Thu, 19 Jul 2012 16:52:54 +0000 References: <50083935$0$6851$e4fe514c@news2.news.xs4all.nl> In-Reply-To: <50083935$0$6851$e4fe514c@news2.news.xs4all.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342716795 news.xs4all.nl 6964 [2001:888:2000:d::a6]:58548 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25633 > >>> ipatterns=0D=0A> ('*=2Etxt', '*=2Ehdf', '*=2Epdf', '*=2Epng')=0D=0A> = >>> igf =3D shutil=2Eignore_patterns(ipatterns)=0D=0A> >>> ignorethis =3D i= gf(ddftopdir,os=2Elistdir(ddftopdir))=0D=0A> =0D=0A> Traceback (most recent= call last):=0D=0A> File "", line 1, in =0D=0A> i= gnorethis =3D igf(ddftopdir,os=2Elistdir(ddftopdir))=0D=0A> File "C:\Pyth= on27\lib\shutil=2Epy", line 138, in _ignore_patterns=0D=0A> ignored_nam= es=2Eextend(fnmatch=2Efilter(names, pattern))=0D=0A> File "C:\Python27\li= b\fnmatch=2Epy", line 49, in filter=0D=0A> pat=3Dos=2Epath=2Enormcase(p= at)=0D=0A> File "C:\Python27\lib\ntpath=2Epy", line 46, in normcase=0D=0A= > return s=2Ereplace("/", "\\")=2Elower()=0D=0A> AttributeError: 'tuple= ' object has no attribute 'replace'=0D=0A> =0D=0A> >>> igg =3D shutil=2Eign= ore_patterns('*=2Etxt', '*=2Ehdf', '*=2Epdf', '*=2Epng')=0D=0A> >>> ignoret= hat =3D igg(ddftopdir, os=2Elistdir(ddftopdir))=0D=0A> >>> ignorethat=0D=0A= > set(['Chi2=2Epng', 'DTSdata=2Ehdf', 'TST=2Ehdf', 'BullNoseDiffs=2Epng',= =0D=0A> 'DTSall=2Ehdf', 'Symmetry=2Epdf'])=0D=0A> >>>=0D=0A> ++++++++++++++= ++++++++++++++=0D=0A> Why does it fail on passing in a tuple of ignore stri= ngs? I thought the ,=0D=0A> (comma) is pretty much the tuple constructor (i= f that is the right word)=2E=0D=0A> =0D=0A> How can I solve this? Is there = a way to convert a tuple of strings in a form=0D=0A> that will be accepted?= =0D=0A>=0D=0A=0D=0AUntested, but I think it should work=2E=0D=0Aigf =3D shu= til=2Eignore_patterns(*ipatterns)=0D=0A=0D=0ARamit=0D=0A=0D=0AThis email is= confidential and subject to important disclaimers and=0D=0Aconditions incl= uding on offers for the purchase or sale of=0D=0Asecurities, accuracy and c= ompleteness of information, viruses,=0D=0Aconfidentiality, legal privilege,= and legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpmorgan=2Eco= m/pages/disclosures/email=2E