[Tutor] listdir, ispath, and unicode

Rob rob@uselesspython.com
Tue, 30 Jul 2002 17:02:25 -0500


Please ignore my last message. I just noticed how much of the original post
I overlooked. (Guess I'm running low on brain fuel at the moment.)

If you care to send me a copy of one of the files, I'll gladly try a thing
or two.

Rob

> -----Original Message-----
> From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
> Rob
> Sent: Tuesday, July 30, 2002 4:51 PM
> To: 'Tutor@Python. Org'
> Subject: RE: [Tutor] listdir, ispath, and unicode
>
>
> I'm also running Win2K on this machine and tried to reproduce
> your problem.
> Here I ran os.listdir on the folder on C:\insight. It displayed
> its contents
> in some detail.
>
> >>> os.listdir('c:\\insight')
> ['abbrev.html', 'begin.html', 'glossary.html', 'history.html',
> 'index-author.html', 'index-names.html', 'index-number.html',
> 'index-similes.html', 'index-subject.html', 'index-sutta.html',
> 'index-title.html', 'index.html', 'other.html', 'sutta101.html',
> 'theravada.html', 'tech', 'cdrom', 'pali', 'ptf', 'icon', 'lib', 'canon',
> 'faq.html', 'help.html', 'news.html', 'search.html', 'bfaq.html',
> 'Tibet-HTML']
>
> Then I ran os.path.isfile on one of the files in that folder thusly:
>
> >>> os.path.isfile('c:\\insight\\index-sutta.html')
> 1
> >>>
>
> All seems well here. It seems that in your code you are asking if
> the folder
> C:\tmp2 is a file, and you are being correctly told that it is not a file.
>
> Do I have all of your facts correct?
>
> Rob
> http://uselesspython.com
>
> > -----Original Message-----
> > From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
> > Poor Yorick
> > Sent: Tuesday, July 30, 2002 3:54 PM
> > To: tutor@python.org
> > Subject: [Tutor] listdir, ispath, and unicode
> >
> >
> > I am running Windows 2000 and have files which use cyrillic characters
> > in their names.  I am running into this problem when I try to work with
> > them:
> >
> >
> >  >>> os.listdir('c:\\tmp2')[0]
> > '????????.url'
> >  >>> os.path.isfile(os.listdir('c:\\tmp2')[0])
> > 0
> >
> >
> > Can anyone tell me why os.path.isfile does not recognize my file?
> >
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>