Bugzilla – Bug 1212
Python module: assign something useful to the per-query data store 'qdata'
Last modified: 2017-03-12 14:59:52 CET
The methods `operate` and `inform_super` both have a parameter named `qdata` which is described as "per query data, here you can store your own data".
However, the python module implementation passes `None` as argument value. There's no way for the python code to assign something else to the per-query data store or modify `None`.
Please consider initializing the per-query data store as `dict`. This would allow the python module script to add custom items.
@github I've prepared a possible patch. Please have a look at: https://github.com/episource/unbound/compare/9a7dfb16f205907413db80eb126c98c08620cef8...episource:dev/pythonmod-data/main
The proposed patch also changes the initialization of the `mod_env` global variable from `None` to a `dict` instance. Certainly, `mod_env` could be ommited completly: If needed, a global variable could be created from the python module's code as well. I see no need for storing the data in the python module's internal C data structures.
Diff url has changed. The diff against current master can be found here: