Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'error:': 0.07; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'collections': 0.16; 'emanuele': 0.16; 'reason.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'syntaxerror:': 0.16; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'follows': 0.31; 'unique,': 0.31; 'writes:': 0.31; 'file': 0.32; 'subject:from': 0.34; 'could': 0.34; 'subject: (': 0.35; 'should': 0.36; 'to:addr :python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'che': 0.60; 'kind': 0.63; 'spot': 0.65; 'invalid': 0.68; '8bit%:100': 0.72; 'soul': 0.74; 'longest': 0.84; 'quando': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lele Gaifax Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain) Date: Tue, 04 Jun 2013 20:18:29 +0200 Organization: Nautilus Entertainments References: <2c425f2b-99de-4453-964e-c585f2043f71@googlegroups.com> <8c16324f-da12-44ff-bf2f-4ae56f9127c0@googlegroups.com> <51ac3bd6$0$11118$c3e8da3@news.astraweb.com> <51ad1cdd$0$11118$c3e8da3@news.astraweb.com> <306a22ea-fbf7-4097-af31-121a999957d6@googlegroups.com> <06a19483-65df-4fcd-9430-b45a01c9dbab@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.126.40 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:HBlbpHnNLR+o39EopWXR6fHJ4Iw= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370369909 news.xs4all.nl 16006 [2001:888:2000:d::a6]:50303 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46951 Νικόλαος Κούρας writes: > root@nikos [~]# [Tue Jun 04 19:50:16 2013] [error] [client 46.12.95.59] File "files.py", line 72 > [Tue Jun 04 19:50:16 2013] [error] [client 46.12.95.59] data = cur.fetchone() #URL is unique, so should only be one > [Tue Jun 04 19:50:16 2013] [error] [client 46.12.95.59] ^ > [Tue Jun 04 19:50:16 2013] [error] [client 46.12.95.59] SyntaxError: invalid syntax Some kind soul already said you the reason. What follows is the longest way I could think to spot your error: >>> from collections import Counter >>> stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, )" >>> chars_count = Counter(stmt) >>> print("Number of '(': %d" % chars_count['(']) >>> print("Number of ')': %d" % chars_count[')']) Number of '(': 2 Number of ')': 1 ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.