[Xcb] [Bug 36056] New: XCB codegen should give a meaningful error message on malformed fieldref

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 7 09:38:22 PDT 2011


           Summary: XCB codegen should give a meaningful error message on
                    malformed fieldref
           Product: XCB
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: medium
         Component: Utils
        AssignedTo: xcb at lists.freedesktop.org
        ReportedBy: bio_tube at yahoo.com
         QAContact: xcb at lists.freedesktop.org

Take the following example protocol:

<?xml version="1.0" encoding="utf-8"?>

<xcb header="bad" extension-name="bad" extension-xname="BAD">
        <request name="BadRequest" code="0">
                <field type="CARD32" name="sizeField" />
                <list type="CARD8" name="dataVector">

When running it through XCB's codegen, the result is a backtrace and a
TypeError that NoneType can't be concatenated with 'str'. As it stands, the
error gives no hint that the issue is that vectorSize isn't a previously
defined field in the request, which can be easily overlooked(especially if the
error is a simple shift failure). Not having any experience in Python, I can't
suggest what would be the best fix, but it looks like adding a check in
get_type_impl(state.py) for id == NoneType should be sufficient for a simple
"Check your fieldrefs" diagnostic.

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the Xcb mailing list