Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'expressions': 0.07; 'rename': 0.07; 'utf-8': 0.07; 'assigning': 0.09; 'filename': 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; 'brackets': 0.16; 'emanuele': 0.16; 'new_path': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'spurious': 0.16; 'variables,': 0.16; ':-)': 0.16; 'basically': 0.19; 'meant': 0.20; 'header:User- Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; "i'm": 0.30; 'writes:': 0.31; 'probably': 0.32; 'skip:b 30': 0.33; 'subject:from': 0.34; 'subject: (': 0.35; 'there': 0.35; 'two': 0.37; 'needed': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'che': 0.60; 'most': 0.60; 'more': 0.64; 'afraid': 0.65; 'here': 0.66; 'close': 0.67; '8bit%:100': 0.72; '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: Thu, 06 Jun 2013 23:07:37 +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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.123.251 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:AileZYWLlu1Fxc/3vHvFfhZTzE8= 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370552854 news.xs4all.nl 15889 [2001:888:2000:d::a6]:36727 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47275 Νικόλαος Κούρας writes: > Tahnks here is what i have up until now with many corrections. I'm afraid many more are needed :-) > ... > # rename filename form greek bytestreams --> utf-8 bytestreams > old_path = b'/home/nikos/public_html/data/apps/' + b'filename') > new_path = b'/home/nikos/public_html/data/apps/' + b'new_filename') > os.rename( old_path, new_path ) a) there are two syntax errors, you have spurious close brackets there b) you are basically assigning *constant* expressions to both variables, most probably not what you meant 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.