Message105716
Here's the session printout. Desktop files under Vista still get deleted despite the exception. Does not occur on Fedora 12 or Mac OS X. I can code around it by testing for a blank filepath, but it was a surprise.
C:\Users\ko5>python
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, shutil, user
>>> desktop_dir = os.path.join(user.home, 'Desktop')
>>> os.chdir(desktop_dir)
>>> os.getcwd()
'C:\\Users\\ko5\\Desktop'
>>> shutil.rmtree('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\shutil.py", line 225, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "C:\Python26\lib\shutil.py", line 223, in rmtree
os.rmdir(path)
WindowsError: [Error 3] The system cannot find the path specified: ''
>>> |
|
Date |
User |
Action |
Args |
2010-05-14 14:58:47 | dbkoch | set | recipients:
+ dbkoch, tarek, ysj.ray |
2010-05-14 14:58:47 | dbkoch | set | messageid: <1273849127.66.0.978958014101.issue8705@psf.upfronthosting.co.za> |
2010-05-14 14:58:46 | dbkoch | link | issue8705 messages |
2010-05-14 14:58:45 | dbkoch | create | |
|