Changing filenames from Greeklish => Greek (subprocess complain)

Chris Angelico rosuav at gmail.com
Tue Jun 4 17:47:17 EDT 2013


On Wed, Jun 5, 2013 at 6:03 AM, Νικόλαος Κούρας <nikos.gr33k at gmail.com> wrote:
>>UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc5' in position >61: surrogates not allowed
>
> This indicates that i'am reading the filenames in a different encoding than what they actually are? What is i try to use bytes for path specifications, and have Python decode them in 'utf-8' ?
>
> fullpaths.add( os.path.join(root, fullpath).encode('utf-8') )

For some reason you have an invalid Unicode codepoint in your string. Fix that.

ChrisA



More information about the Python-list mailing list