[issue8705] shutil.rmtree with empty filepath

2010-11-20 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Just as an FYI, a similar situation exists on Solaris.  I had to fix one of the 
Python test suite tests once because it was naively trying to rmtree the CWD.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8705
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8705] shutil.rmtree with empty filepath

2010-11-19 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

This can't actually work. You can't delete a directory which has open handles 
to it on Windows, namely the Python process you're running in that directory.

The empty file path isn't really the issue here. shutil.rmtree(os.getcwd()) 
attempts the same thing but gives you a better error message since a full path 
gets sent down to os.rmdir rather than .

--
nosy: +brian.curtin
resolution:  - rejected
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8705
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8705] shutil.rmtree with empty filepath

2010-05-14 Thread Tarek Ziadé

Changes by Tarek Ziadé ziade.ta...@gmail.com:


--
assignee:  - tarek
priority: normal - low

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8705
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8705] shutil.rmtree with empty filepath

2010-05-14 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Dan,

Can I have the error you get ?

Thanks

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8705
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8705] shutil.rmtree with empty filepath

2010-05-14 Thread Dan Koch

Dan Koch koc...@ornl.gov added the comment:

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\ko5python
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: ''


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8705
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8705] shutil.rmtree with empty filepath

2010-05-13 Thread Dan Koch

New submission from Dan Koch koc...@ornl.gov:

The following sequence raises an exception, but nonetheless removes all files 
from the Desktop under Windows Vista.

import os, shutil, user

desktop_dir = os.path.join(user.home, 'Desktop')
os.chdir(desktop_dir)

shutil.rmtree('')

This does not occur under Fedora 12. Not tested on Mac OS X yet.

--
components: Windows
messages: 105646
nosy: dbkoch
priority: normal
severity: normal
status: open
title: shutil.rmtree with empty filepath
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8705
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com