Closed jsivak closed 10 years ago
Is this the correct place to file this bug?
Yes for sure, sorry for the late, checking it.
We are refactoring the spool decorator to fix this issue and to correctly support python 3. Thanks for your report
It should be fixed now, thanks for your report.
So this should be in the next (2.0.8) release?
@jsivak You can already use it with
pip install uwsgidecorators
@aldur splitted it a couple of days ago
Ah, thanks! I didn't realize it was going to be released "outside" of the main uwsgi package.
Found using Python 2.7 and uWSGI 2.0.6.
Executing @spool() decorated functions in this order will result in 'arg3' still being passed to the "do_something()" task on the 3rd call, even though it wasn't explicitly passed.
Example:
The problem appears to be in the handling of the
arguments
variable in uwsgidecorators.py around line 70.I believe the assignment of
arguments = self.base_dict
needs to be set to a copy ofself.base_dict
, not a reference, so the correct line should bearguments = self.base_dict.copy()
. Currentlyarguments
is getting the reference toself.base_dict
and any keyword args that are being passed to the@spool()
decorated function are being added/remembered across function calls to the decorated function, which is more obvious when the number of keyword arguments to a single spooled function changes.I believe a shallow copy of
self.base_dict
should work, but not 100% sure on that.