shutils.move lose files !

Shagshag shagshag13 at yahoo.fr
Thu Mar 18 08:27:10 EST 2004


hello,

here is a behavior that i discover by error : 

in the following example directory 'stupid' is lost such as eventual
files and directory contained in it (for example 'atest.txt') while i
would have prefer to be warned or at least nothing to happen.

is it a bug ? 

----------
Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
    
IDLE 1.0.2      
>>> import os
>>> os.mkdir('c:/stupid')
>>> open('c:/stupid/atest.txt', 'w').write('a file')
>>> os.listdir('c:/stupid')
['atest.txt']
>>> import shutil
>>> shutil.move('c:/stupid', 'c:/stupid/donotexist')
>>> os.listdir('c:/stupid')

Traceback (most recent call last):
  File "<pyshell#22>", line 1, in -toplevel-
    os.listdir('c:/stupid')
WindowsError: [Errno 3] Le chemin d'accès spécifié est introuvable:
'c:/stupid/*.*'
>>>



More information about the Python-list mailing list