Strange exceptions raised by os.renames and shutil.copytree

Darren New dnew at san.rr.com
Sat Jan 13 16:47:26 EST 2001


> The second way I tried was using os.renames(), but that raised OSError
> [errno 13].  Now I realize that normally this would be resolved by
> making sure that all files in the directory being renamed were closed,
> but the problem is that I don't have any files open from the directory.
>  The only thing the program has done to the source directory up to that
> point is os.listdir() and os.path.isdir() on the directory.

Just a guess, but make sure your current directory isn't the directory
you're trying to rename before you try renaming it. os.path.listdir() might
leave you cwd set to what it listed or something?

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST).  Cryptokeys on demand.
   Crunching tiger, hidden dragon



More information about the Python-list mailing list