Re: [PATCH] Use shutil.move when os.rename fails


Andre McCurdy
 

On Mon, Mar 29, 2021 at 4:07 PM Devendra Tewari
<devendra.tewari@...> wrote:

I did try that but got an error that does not happen when we try os.rename first. I'll try to reproduce it again.

I suspect there may be subtle differences in os.rename vs shutil.move with respect to what happens when origin and/or destination do not exist or are invalid.
If there are subtle issues which you don't yet understand then that's
all the more reason for not hiding the new shutil.move code behind a
test which will pass for 99.9% of users. Please figure that out before
sending another version of the patch.

On 29 Mar 2021, at 20:00, Andre McCurdy <armccurdy@...> wrote:

On Mon, Mar 29, 2021 at 3:45 PM Devendra Tewari
<devendra.tewari@...> wrote:

Thanks! My bad. The example I looked up in Python docs had a break and I just realized it was a looping example.

Here’s the updated patch (or should I submit it again via git send-email?)
It would be better to use shutil.move unconditionally in all cases,
rather than have a separate shutil.move code path which only gets
tested by people doing incremental builds in docker.

Join openembedded-core@lists.openembedded.org to automatically receive all group messages.