Re: Preventing 'bad' filenames from raising errors in os.path

2008-05-05 Thread python
Matimus and John, Thank you both for your feedback. Matimus: I agree with your analysis. I blame lack of caffeine for my original post :) Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Preventing 'bad' filenames from raising errors in os.path

2008-05-03 Thread John Nagle
[EMAIL PROTECTED] wrote: Bad file names, i.e. filenames the OS considers illegal, will cause functions in the os.path module to raise an error. Example: import os.path print os.path.getsize( 'c:/pytest/*.py' ) The issue, I think, is there's no function that checks syntax of a path name wit

Re: Preventing 'bad' filenames from raising errors in os.path

2008-05-02 Thread Martin v. Löwis
> Now, I can understand if you don't like the "WindowsError" as that is > obviously platform specific. The try/except pattern however is the way > errors are handled in python and the best and most appropriate way to > deal with it. The above example just shows that at the very least > there isn't

Re: Preventing 'bad' filenames from raising errors in os.path

2008-05-02 Thread Matimus
On May 2, 9:40 am, [EMAIL PROTECTED] wrote: > Bad file names, i.e. filenames the OS considers illegal, will cause > functions in the os.path module to raise an error. > > Example: > > import os.path > print os.path.getsize( 'c:/pytest/*.py' ) > > On Windows XP using Python 2.5.2 I get the following