Changing filenames from Greeklish => Greek (subprocess complain)

MRAB python at mrabarnett.plus.com
Thu Jun 6 17:57:42 EDT 2013


On 06/06/2013 22:07, Lele Gaifax wrote:
> Νικόλαος Κούρας <nikos.gr33k at gmail.com> 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
>
Yet again, he's changed things unnecessarily, and the code was meant 
only as a one-time
fix to correct the encoding of some filenames. :-(



More information about the Python-list mailing list