Bug 10186

Summary: Typo in adding an event handler leads to confusing error
Product: [Build System, Metadata & Runtime] BitBake Reporter: Mark Hatle <mark.hatle>
Component: bitbakeAssignee: Markus Lehtonen <markus.lehtonen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, sgw
Version: 2.2   
Target Milestone: 2.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mark Hatle 2016-08-24 22:35:17 UTC
Create a class that looks like:

addhandler my_test_handler


Include the class, and the following error occurs:

ERROR: Error parsing configuration files
Traceback (most recent call last):
  File "/home/mhatle/git/oss/oe-core/bitbake/lib/bb/cookerdata.py", line 265, in CookerDataBuilder.parseBaseConfiguration():
                 bb.parse.init_parser(self.basedata)
    >            self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
     
  File "/home/mhatle/git/oss/oe-core/bitbake/lib/bb/cookerdata.py", line 360, in CookerDataBuilder.parseConfigurationFiles(prefiles=[], postfiles=[]):
                 handlerfn = data.getVarFlag(var, "filename", False)
    >            handlerln = int(data.getVarFlag(var, "lineno", False))
                 bb.event.register(var, data.getVar(var, False),  (data.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'


It would be better if bitbake reported "unable to find event handler 'my_test_handler'" or something like that.
Comment 1 Markus Lehtonen 2016-08-30 09:54:36 UTC
Patch sent for review:
https://patchwork.openembedded.org/patch/130609/