Hello all,

There may be a reasonable cause for this (i.e. it is likely to be my 
fault) - but it is consistent across two different machines I have tried 
it on.

With Python 2.5b2 (from the msi at Python.org), running on Windows XP 
Pro SP2,  ``os.utime`` and ``os.chmod`` fail with WindowsError. The same 
code runs fine on Python 2.3 and Python 2.4.

[err]     shutil.copytree(thisentry, targetdir)
[err]   File "C:\Python25\lib\shutil.py", line 130, in copytree
[err]     copystat(src, dst)
[err]   File "C:\Python25\lib\shutil.py", line 67, in copystat
[err]     os.utime(dst, (st.st_atime, st.st_mtime))
[err] WindowsError: [Error 13] Access is denied: 'lib\\Pmw'
[err]

The script uses ``shutil.copytree`` to copy a directory (using relative 
paths).

The source code snippet is :

if os.path.isdir(targetdir):
    shutil.rmtree(targetdir)
shutil.copytree(thisentry, targetdir)

The code in shutil.py is :

def copystat(src, dst):
    """Copy all stat info (mode bits, atime and mtime) from src to dst"""
    st = os.stat(src)
    mode = stat.S_IMODE(st.st_mode)
    if hasattr(os, 'utime'):
        os.utime(dst, (st.st_atime, st.st_mtime))
    if hasattr(os, 'chmod'):
        os.chmod(dst, mode)


Additionally, after running a couple of times I get core dumps when 
trying to run the interactive interpreter. Oddly IDLE and other programs 
still run. However this is after installing py2exe, wxPython and pywin32 
(all of which have Python 2.5 builds), so there is possibly some weird 
interaction.

My install directory has the following three dlls in it :

MSVCIRT.dll
MSVCP60.dll
MSVCRT.dll

It has none of the msvc7 dlls that I would expect.

I'm now at work and so don't have time to experiment, but tonight I will 
try uninstalling all my Python 2.5 stuff and re-installing just 2.5b2. I 
will see what dlls are present, run the interpreter a few times, and 
test a simple script with shutil.copytree.

All the best,


Michael Foord
http://www.voidspace.org.uk/python/index.shtml
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to