Re: Incorrect Python errors when using os.remove to delete a directory

2015-12-02 Thread Adam Dinwoodie
On Fri, Nov 27, 2015 at 04:09:52PM +0100, Michael Wild wrote: > On Fri, Nov 27, 2015 at 3:51 PM, Adam Dinwoodie wrote: > > If I use os.remove in Python to remove a directory, I expect it to fail > > with an OSError on Python2 or a IsADirectoryError on Python3. On > > Python2, I get OSError, but wi

Re: Incorrect Python errors when using os.remove to delete a directory

2015-11-27 Thread Michael Wild
On Fri, Nov 27, 2015 at 3:51 PM, Adam Dinwoodie wrote: > If I use os.remove in Python to remove a directory, I expect it to fail > with an OSError on Python2 or a IsADirectoryError on Python3. On > Python2, I get OSError, but with the wrong error code, whereas on > Python3 I get completely the wr

Incorrect Python errors when using os.remove to delete a directory

2015-11-27 Thread Adam Dinwoodie
If I use os.remove in Python to remove a directory, I expect it to fail with an OSError on Python2 or a IsADirectoryError on Python3. On Python2, I get OSError, but with the wrong error code, whereas on Python3 I get completely the wrong exception. Simple testcases: $ rm -rf testdir && mkdir