shutil _isindir

David Hoese dhoese at gmail.com
Sat Oct 22 08:49:52 EDT 2011


I was about to submit a bug report, but while testing I have figured out 
that my specific problem has been solved in Python 2.7 (server that I 
was using had 2.6 on it).  You can see the differences here:

2.6: http://hg.python.org/cpython/file/b9a95ce2692c/Lib/shutil.py
2.7: http://hg.python.org/cpython/file/d30482d51c25/Lib/shutil.py

You'll notice that in move(), there is now a check for the same file, 
which if they're not the same file you don't get unexpected deleted 
files.  If you still think I should submit a bug report let me know and
provide me with the test case...or just submit the bug yourself.

-Dave

P.S. Sorry for the original poor subject line, was a place holder
that I forgot to change.

On 10/22/2011 5:00 AM, python-list-request at python.org wrote:
> Subject:
> Re: shutil _isindir
> From:
> Steven D'Aprano <steve+comp.lang.python at pearwood.info>
> Date:
> 10/22/2011 4:03 AM
>
> To:
> python-list at python.org
>
>
> On Fri, 21 Oct 2011 22:13:06 -0500, David Hoese wrote:
>
>> >  So I guess what I'm asking is what are the reasons that _destinsrc uses
>> >  abspath instead of realpath?  And is there a better place to ask this?
> Probably because abspath goes back to Python 1.5, while realpath is
> comparatively recent only going back to 2.2, and nobody has thought to
> change the code in shutil.
>
> I recommend you raise a bug/feature request on the bug tracker,
> preferably with a fix and a test demonstrating the problem.
>
> http://bugs.python.org/



More information about the Python-list mailing list