ianaré added the comment:
Sorry about that. Here is the output from $ svn diff
I've also made modifications to allow to ignore the permission errors
(defaults to no) - should I post here or file new report?
Added file: http://bugs.python.org/file8876/shutil
ianaré added the comment:
hmm, marked me as spam ... the tar.gz posted last message contains the
original shutil, a patched version, and the diff
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/
ianaré added the comment:
sorry, should have clarified, I tested with this code:
copy2
try:
copystat(src, dst)
except OSError, err:
if WindowsError is not None and isinstance(err, WindowsError):
pass
else:
raise
copytree
try:
copystat(src, dst)
except OSError
ianaré added the comment:
OK I see that now. For what it's worth, I tested the code on win2000,
XP, and ubuntu using the shutil.move command on files and folders (so
that it uses either copy2 or copytree). Apart from the original bug in
ubuntu (copy from ext3 to ntfs-3g) it is fine.
I
ianaré added the comment:
Rather than try in copytree and try again in copy2, why not add this to
the root of the issue - copystat. Something like this?
def copystat(src, dst, ignore_permission_err=False):
"""Copy all stat info (mode bits, atime and mtime) from src t
ianaré added the comment:
Yes, it is a sub-class of OSError. So then only catching OSError should
be sufficient? Or am I missing something?
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/
ianaré added the comment:
The problem with WindowsError is that it is not included in Linux. So if
there is an exception, it fails without showing the actual error. See
here (ubuntu 7.10 default install):
>>> try: print a
... except WindowsError:
... print 'b'
...
Tra
ianaré added the comment:
I must respectfully disagree. This bug also occurs during the copytree
command, so it can apply to more than one file. And if using from move
then the original file never gets deleted.
As far as working around it, it is obviously doable, however this
requires
ianaré added the comment:
I agree, the best would be to have the option of ignoring errors.
However, I think there should be a way to differentiate between errors
that prevent a file from being copied, and one that only affects
permissions.
__
Tracker <[EM
New submission from ianaré:
When using shutil.copy2 or copytree where the source is on a filesystem
that has octal permissions (ie ext3) and the destination is on an NTFS
partition mounted rw, the operation fails with
OSError: [Errno 1] Operation not permitted
I am attaching a version of
10 matches
Mail list logo