Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.04; 'syntax': 0.04; 'detect': 0.07; 'rename': 0.07; 'tries': 0.07; 'utf-8': 0.07; 'arguments': 0.09; 'arguments,': 0.09; 'imply': 0.09; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '*function*': 0.16; '*must*': 0.16; 'above?': 0.16; 'accepts': 0.16; 'emanuele': 0.16; 'indications': 0.16; 'least)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'syntaxerror:': 0.16; 'fix': 0.17; 'header:User-Agent:1': 0.23; 'source': 0.25; 'header:X -Complaints-To:1': 0.27; 'function': 0.29; 'specifically': 0.29; 'statement': 0.30; 'code': 0.31; 'usually': 0.31; 'though.': 0.31; 'writes:': 0.31; 'yourself.': 0.31; 'file': 0.32; 'subject:from': 0.34; 'subject: (': 0.35; "can't": 0.35; 'convert': 0.35; 'but': 0.35; 'right?': 0.36; 'wrong': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'che': 0.60; 'tell': 0.60; 'introduced': 0.61; 'further': 0.61; 'email addr:gmail.com': 0.63; 'invalid': 0.68; 'greek': 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: Fri, 07 Jun 2013 09:09:29 +0200 Organization: Nautilus Entertainments References: <2c425f2b-99de-4453-964e-c585f2043f71@googlegroups.com> <9c482ba0-23ac-4e66-a0e1-a18be9fd82d8@googlegroup> <06a19483-65df-4fcd-9430-b45a01c9dbab@googlegroups.com> <51aed313$0$11118$c3e8da3@news.astraweb.com> <4c19b71d-4de5-41ad-b6ae-fb133a6c331e@googlegroups.com> <2be143c4-77c6-4c84-ba1c-46b02bd503ff@googlegroups.com> <1465c96b-c33e-4d5b-894e-b184c031a185@googlegroups.com> <808b7897-8ed4-4e0e-8976-4a22ae7f24cd@googlegroups.com> <332812d7-71b3-4bbb-a846-09827a6df65d@googlegroups.com> <152c78f5-b777-44e2-a83d-a23ecf2f84a3@googlegroups.com> <51b13693$0$29966$c3e8da3$5496439d@news.astraweb.com> <3c1e7a3f-5e41-4ab8-bced-755a9ad6327d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.149.93 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:Tz0fTCAtACW+QoJ8L0u0vyeX3Ok= 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370588966 news.xs4all.nl 15995 [2001:888:2000:d::a6]:60805 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47312 nagia.retsina@gmail.com writes: > File "files.py", line 75 > os.rename( filepath_bytes filepath.encode('utf-8') ) > ^ > SyntaxError: invalid syntax > > I am seeign the caret pointing at filepath but i cant follow what it > tries to tell me. As already explained, often a SyntaxError is introduced by *preceeding* "text", so you must look at your code with a "wider eye". > This rename statement tries to convert the greek byted filepath to > utf-8 byted filepath. Yes: and that usually imply that the *function* accepts (at least) *two* arguments, specifically the source and the target names, right? How many arguments are you actually giving to the os.rename() function above? > I can't see whay this is wrong though. Try stronger, I won't be give you further indications to your SyntaxErrors, you *must* learn how to detect and fix those by yourself. 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.