Re: os.walk the apostrophe and unicode

2017-06-25 Thread Rod Person
On Sun, 25 Jun 2017 08:18:45 -0600 Michael Torrie wrote: > On 06/25/2017 06:19 AM, Rod Person wrote: > > But doing a simple ls of that directory show it is unicode but the > > replacement of the offending character. > > > > http://rodperson.com/graphics/uc/ls.png > > Now

Re: os.walk the apostrophe and unicode

2017-06-25 Thread Peter Otten
Rod Person wrote: > Ok...so after reading all the replies in the thread, I thought I would > be easier to send a general reply and include some links to screenshots. > > As Peter mention, the logic thing to do would be to fix the file name > to what I actually thought it was and if this was for

Re: os.walk the apostrophe and unicode

2017-06-25 Thread Michael Torrie
On 06/25/2017 06:19 AM, Rod Person wrote: > But doing a simple ls of that directory show it is unicode but the > replacement of the offending character. > > http://rodperson.com/graphics/uc/ls.png Now that is really strange. Your OS seems to not recognize that the filename is in UTF-8. I

Re: os.walk the apostrophe and unicode

2017-06-25 Thread Rod Person
Ok...so after reading all the replies in the thread, I thought I would be easier to send a general reply and include some links to screenshots. As Peter mention, the logic thing to do would be to fix the file name to what I actually thought it was and if this was for work that probably what I

Re: os.walk the apostrophe and unicode

2017-06-25 Thread alister
On Sun, 25 Jun 2017 02:23:15 -0700, wxjmfauth wrote: > Le samedi 24 juin 2017 21:10:47 UTC+2, alister a écrit : >> On Sat, 24 Jun 2017 14:57:21 -0400, Rod Person wrote: >> >> > \xe2\x80\x99, >> >> because the file name has been created using "Right single quote" >> instead of apostrophe, the

Re: os.walk the apostrophe and unicode

2017-06-25 Thread Peter Otten
Steve D'Aprano wrote: > On Sun, 25 Jun 2017 04:57 pm, Peter Otten wrote: >> if everything worked correctly? Though I don't understand why the OP >> doesn't see >> >> '06 - Toddâ\x80\x99s Song (Post-Spiderland Song in Progress).flac' >> >> which is the repr() that I get. > > That's mojibake

Re: os.walk the apostrophe and unicode

2017-06-25 Thread Steve D'Aprano
On Sun, 25 Jun 2017 04:57 pm, Peter Otten wrote: > Steve D'Aprano wrote: > >> On Sun, 25 Jun 2017 07:17 am, Peter Otten wrote: >> >>> Then I'd fix the name manually... >> >> The file name isn't broken. >> >> >> What's broken is parts of the OP's code which assumes that non-ASCII file >>

Re: os.walk the apostrophe and unicode

2017-06-25 Thread Peter Otten
Steve D'Aprano wrote: > On Sun, 25 Jun 2017 07:17 am, Peter Otten wrote: > >> Then I'd fix the name manually... > > The file name isn't broken. > > > What's broken is parts of the OP's code which assumes that non-ASCII file > names are broken... Hm, the OP says '06 - Todd\xe2\x80\x99s Song

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Steve D'Aprano
On Sun, 25 Jun 2017 07:17 am, Peter Otten wrote: > Then I'd fix the name manually... The file name isn't broken. What's broken is parts of the OP's code which assumes that non-ASCII file names are broken... -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Peter Otten
Rod Person wrote: > On Sat, 24 Jun 2017 21:28:45 +0200 > Peter Otten <__pete...@web.de> wrote: > >> Rod Person wrote: >> >> > Hi, >> > >> > I'm working on a program that will walk a file system and clean the >> > id3 tags of mp3 and flac files, everything is working great until >> > the follow

Re: os.walk the apostrophe and unicode

2017-06-24 Thread MRAB
On 2017-06-24 20:47, Rod Person wrote: On Sat, 24 Jun 2017 13:28:55 -0600 Michael Torrie wrote: On 06/24/2017 12:57 PM, Rod Person wrote: > Hi, > > I'm working on a program that will walk a file system and clean the > id3 tags of mp3 and flac files, everything is working

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Andre Müller
Can os.fsencode and os.fsdecode help? I've seen it somewhere. I've never used it. To fix encodings, sometimes I use the module ftfy Greetings Andre -- https://mail.python.org/mailman/listinfo/python-list

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Rod Person
On Sat, 24 Jun 2017 13:28:55 -0600 Michael Torrie wrote: > On 06/24/2017 12:57 PM, Rod Person wrote: > > Hi, > > > > I'm working on a program that will walk a file system and clean the > > id3 tags of mp3 and flac files, everything is working great until > > the follow file

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Rod Person
On Sat, 24 Jun 2017 21:28:45 +0200 Peter Otten <__pete...@web.de> wrote: > Rod Person wrote: > > > Hi, > > > > I'm working on a program that will walk a file system and clean the > > id3 tags of mp3 and flac files, everything is working great until > > the follow file is found > > > > '06 -

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Peter Otten
Rod Person wrote: > Hi, > > I'm working on a program that will walk a file system and clean the id3 > tags of mp3 and flac files, everything is working great until the > follow file is found > > '06 - Todd's Song (Post-Spiderland Song in Progress).flac' > > for some reason that I can't

Re: os.walk the apostrophe and unicode

2017-06-24 Thread Michael Torrie
On 06/24/2017 12:57 PM, Rod Person wrote: > Hi, > > I'm working on a program that will walk a file system and clean the id3 > tags of mp3 and flac files, everything is working great until the > follow file is found > > '06 - Todd's Song (Post-Spiderland Song in Progress).flac' > > for some

Re: os.walk the apostrophe and unicode

2017-06-24 Thread MRAB
On 2017-06-24 19:57, Rod Person wrote: Hi, I'm working on a program that will walk a file system and clean the id3 tags of mp3 and flac files, everything is working great until the follow file is found '06 - Todd's Song (Post-Spiderland Song in Progress).flac' for some reason that I can't

Re: os.walk the apostrophe and unicode

2017-06-24 Thread John Ladasky
On Saturday, June 24, 2017 at 12:07:05 PM UTC-7, Rod Person wrote: > Hi, > > I'm working on a program that will walk a file system and clean the id3 > tags of mp3 and flac files, everything is working great until the > follow file is found > > '06 - Todd's Song (Post-Spiderland Song in

Re: os.walk the apostrophe and unicode

2017-06-24 Thread alister
On Sat, 24 Jun 2017 14:57:21 -0400, Rod Person wrote: > \xe2\x80\x99, because the file name has been created using "Right single quote" instead of apostrophe, the glyphs look identical in many fonts. -- "If you understand what you're doing, you're not learning anything." --

os.walk the apostrophe and unicode

2017-06-24 Thread Rod Person
Hi, I'm working on a program that will walk a file system and clean the id3 tags of mp3 and flac files, everything is working great until the follow file is found '06 - Todd's Song (Post-Spiderland Song in Progress).flac' for some reason that I can't understand os.walk() returns this file name