Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Terry Reedy
On 7/19/2011 2:15 AM, Thomas 'PointedEars' Lahn wrote: Steven D'Aprano wrote: Nulpum wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? Yes. print "logs/2011-07-03" logs/2011-07-03 print "logs\2011-07-03" l

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Grant Edwards
On 2011-07-19, Nulpum wrote: > I want to make sure that folder exists. > > '2011-07-03' is really exists. but 'os.path.isdir' say false > > Does anyone know why? > > > os.path.isdir("C:\Users\??\Desktop\logs") > True os.path.isdir("C:\Users\??\Desktop\logs\2011-07-03") > False Y

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Ethan Furman
Steven D'Aprano wrote: Thomas Jollans wrote: The "correct" solution in many cases is to not assume any particular path separator at all, and use os.path.join when dealing with paths. This will work even on systems that do not accept forward slashes as path separators. (does Python still support

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Changjun
On 7월19일, 오후3시15분, Thomas 'PointedEars' Lahn wrote: > Steven D'Aprano wrote: > > Nulpum wrote: > >> I want to make sure that folder exists. > > >> '2011-07-03' is really exists. but 'os.path.isdir' say false > > >> Does anyone know why? > > > Yes. > > print "logs/2011-07-03" > > logs/2011-07-

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Steven D'Aprano
Thomas Jollans wrote: > On 19/07/11 06:42, Steven D'Aprano wrote: >> (1) Escape every backslash with an extra backslash: >> > print "logs\\2011-07-03" >> logs\2011-07-03 > > There is a more elegant solution: use raw strings: r'c:\foo\bar' Well, perhaps, but not all paths can be written as

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Nulpum
On Jul 19, 1:42 pm, Steven D'Aprano wrote: > Nulpum wrote: > > I want to make sure that folder exists. > > > '2011-07-03' is really exists. but 'os.path.isdir' say false > > > Does anyone know why? > > Yes. > > >>> print "logs/2011-07-03" > logs/2011-07-03 > >>> print "logs\2011-07-03" > > logs 1-

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Thomas Jollans
On 19/07/11 06:42, Steven D'Aprano wrote: > Nulpum wrote: > >> I want to make sure that folder exists. >> >> '2011-07-03' is really exists. but 'os.path.isdir' say false >> >> Does anyone know why? > > Yes. > print "logs/2011-07-03" > logs/2011-07-03 print "logs\2011-07-03" > logs�1-07

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Thomas 'PointedEars' Lahn
Steven D'Aprano wrote: > Nulpum wrote: >> I want to make sure that folder exists. >> >> '2011-07-03' is really exists. but 'os.path.isdir' say false >> >> Does anyone know why? > > Yes. > print "logs/2011-07-03" > logs/2011-07-03 print "logs\2011-07-03" > logs�1-07-03 > > Don't use

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Rob Williscroft
Nulpum wrote in news:0bf400a3-735c-487a-8d74- feb3b56be...@g5g2000prn.googlegroups.com in gmane.comp.python.general: > I want to make sure that folder exists. > '2011-07-03' is really exists. but 'os.path.isdir' say false > Does anyone know why? > os.path.isdir("C:\Users\Á¶Ã¢ÁØ\Desktop\logs"

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Steven D'Aprano
Nulpum wrote: > I want to make sure that folder exists. > > '2011-07-03' is really exists. but 'os.path.isdir' say false > > Does anyone know why? Yes. >>> print "logs/2011-07-03" logs/2011-07-03 >>> print "logs\2011-07-03" logs�1-07-03 Don't use backslashes as path separators in Python. Back

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Michael Hrivnak
What is the output of: >>> os.path.exists("C:\Users\조창준\Desktop\logs\2011-07-03") ? One possible issue here is that for some reason os.path.isdir() can't even access the directory either because of permissions, misinterpretation of the path, or some other reason. Michael 2011/7/19 Nulpum : > I

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Kushal Das
2011/7/19 Nulpum : > I want to make sure that folder exists. > > '2011-07-03' is really exists. but 'os.path.isdir' say false > > Does anyone know why? > > > os.path.isdir("C:\Users\조창준\Desktop\logs") > True os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03") > False Works here. Are you

os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Nulpum
I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? >>> os.path.isdir("C:\Users\조창준\Desktop\logs") True >>> os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03") False -- http://mail.python.org/mailman/listinfo/python-list