[PATCH] fix for bug 12292

Rowland Penny repenny241155 at gmail.com
Wed Sep 28 14:48:03 UTC 2016


On Wed, 28 Sep 2016 17:37:37 +0300
Alexander Bokovoy <ab at samba.org> wrote:

> On ke, 28 syys 2016, Rowland Penny wrote:
> > > > > However, I think Douglas was trying to point out that it is
> > > > > bad practice in Python programming to have 'except' without
> > > > > specific exception -- catch-all cases are almost every time
> > > > > wrong. So if you know that there will be an index error, just
> > > > > catch that exception type to handle it properly.
> > > > 
> > > > Well yes, but I only found out what the exception was by adding
> > > > 'Exception, e' to the line i.e. I hadn't a clue
> > > > 
> > > > I personally think you are all getting bogged down in
> > > > technicalities here, what does it matter why the user couldn't
> > > > be found, it couldn't be found!
> > > Correct. However, if there would be another reason, like genuine
> > > error in the underlying software stack, the 'except IndexError,
> > > e' exception handling would allow us to crash with a proper
> > > backtrace to see that issue. A plain 'except:' or 'except
> > > Exception, e' will cover up any error and will complicate
> > > debugging. That's one point why we insist on this technicality.
> > > 
> > 
> > OK, that's me over there waving the white flag ;-)
> > 
> > I will alter the patch to use 'except IndexError, e' ,
> > but before I do, is there anything else wrong with my patch ???
> I don't see anything else being incorrect in it.
> 

OK, See the attached patch

Rowland
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug-12292-stop-user.py-throwing-errors-if-user-is-un.patch
Type: text/x-patch
Size: 1728 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160928/0eddb681/bug-12292-stop-user.py-throwing-errors-if-user-is-un.bin>


More information about the samba-technical mailing list