[PATCH] pidl-Python: Fix code generated for WERROR type

Kamen Mazdrashki kamenim at samba.org
Fri Oct 8 13:58:10 MDT 2010

On Fri, Oct 8, 2010 at 17:10, Jelmer Vernooij <jelmer at samba.org> wrote:

> On Fri, 2010-10-08 at 16:07 +0200, Jelmer Vernooij wrote:
> > On Fri, 2010-10-08 at 04:27 +0300, Kamen Mazdrashki wrote:
> > > What do you think about last 3 commits in my wip branch:
> > >
> http://git.samba.org/?p=kamenim/samba.git;a=shortlog;h=refs/heads/pylint-fix-build
> >
> > For the last patch, I think we should be unlinking from obj->talloc_ctx
> > not NULL, otherwise we end up leaking memory. Thanks for fixing that
> > btw. Ideally we should also be checking the return value of
> > talloc_unlink(), although I'm not really sure what the right thing to do
> > is when it returns failure.
> >
> > +1 on the warning fix.
> >
> > I don't see the need for the third patch. The caller shouldn't pass in
> > tuples where an error is expected. WERRORs are only 32 bits so int
> > objects should be sufficient there.
> >
> > Can you give a bit more background as to why you need that third patch?
> Sorry, I should've actually checked the commit message rather than just
> looking at the code to understand your motivation for that change.
> I think the bug here is that we shouldn't be returning a tuple for
> WERRORs. If we really want to avoid the error lookup for the user I
> think we should add a WERROR equivalent object in Python (perhaps
> descending from Exception?).
> I agree this is the right way to go. The patch was intended to just fix the
Please apply it if you consider it useful, it is not important for me atm
(actually I was trying to implement a check for uint32 -> PyInt -> uint32
conversion when I hit this while testing)


More information about the samba-technical mailing list