[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-patches
Subject:    [Patches] [ python-Patches-1242454 ] shutil.copytree() quits too
From:       noreply () sourceforge ! net (SourceForge ! net)
Date:       2005-08-31 22:50:09
Message-ID: E1EAbPF-00078P-5j () sc8-sf-web2 ! sourceforge ! net
[Download RAW message or body]

Patches item #1242454, was opened at 2005-07-21 19:24
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1242454&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Dale Wilson (dalewilson)
Assigned to: Nobody/Anonymous (nobody)
Summary: shutil.copytree() quits too soon after an error.

Initial Comment:
When shutil.copytree has been called recursively and
catches an error from copy2 it adds the message to the
errors list, then continues to copy the remaining items
in that directory.  This is good.

At the end of the directory, however it raises an Error
which escapes all the way back to the original caller.
 As a result the remaining contents of any parent
directories do not get copied.

The attached patch adds an "except Error" on the try
surrounding the recursive call.  Errors are accumulated
then the copy continues.  The result is that all files
that can be copied do get copied and all files that
cannot be copied are accumulated in the Error that
ultimately is thrown to the caller.

.



----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-01 00:50

Message:
Logged In: YES 
user_id=1188172

The patch had an error in it:

"""except Error, errors"""

Here "errors" is NOT the list of errors given as argument to
the exception when raised with

"""raise Error, errors""".

Apart from that, applied the change as Lib/shutil.py 1.37,
1.34.2.1.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1242454&group_id=5470

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic