mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-07 14:11:46 +00:00
Fix invalid 'args' and 'kwargs' decoding in python3
When we set pass_arguments=True, we should unpickle 'args' and 'kwargs' first. Without it '_decode_from_spooler' will fail on 'decoding' their packed by pickle data, because pickled data has 'bytes' type.
This commit is contained in:
@@ -20,8 +20,10 @@ class BitmapTest(unittest.TestCase):
|
||||
spooler_handlers.controlled_task.spool(arg='barbis')
|
||||
spooler_handlers.controlled_raw_task.spool(arg='alive', ghost='world')
|
||||
spooler_handlers.controlled_raw_task.spool(arg='barbis')
|
||||
spooler_handlers.controlled_arguments_task.spool(
|
||||
{'key': 'value'}, 2, key1='value1')
|
||||
|
||||
for i in range(4):
|
||||
for i in range(5):
|
||||
uwsgi.signal_wait(20)
|
||||
print("Signal received!")
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@ import uwsgi
|
||||
ghostpath = "/tmp/ghost"
|
||||
|
||||
|
||||
@spool(pass_arguments=True)
|
||||
def controlled_arguments_task(*args, **kwargs):
|
||||
if args != ({'key': 'value'}, 2) or kwargs != {'key1': 'value1'}:
|
||||
print("We have a problem!")
|
||||
open(ghostpath, 'w').close()
|
||||
uwsgi.signal(20)
|
||||
|
||||
|
||||
@spool
|
||||
def controlled_task(arguments):
|
||||
if arguments['arg'] != 'alive' and 'ghost' in arguments:
|
||||
|
||||
Reference in New Issue
Block a user