From 4c3dfcb60a91beb1fe3315d0569e7b34557657eb Mon Sep 17 00:00:00 2001 From: Franz Chih-Ping Hsieh Date: Aug 13 2018 20:53:57 +0000 Subject: decode_args(): make a copy of the opts dict, rather than modifying it in-place Fixes: #1007 https://pagure.io/koji/issue/1007 Author: Mike Bonnet Date: Wed Jul 18 17:03:56 2018 -0700 The commit changes make_task() to call decode_args() on the arglist before it is saved to the db. If the method was called with keyword arguments, those would be passed in a dict at the end of the arglist, with a __starstar entry. decode_args() edits that dict in place, removing the __starstar entry and making the arglist appear to end in a single dict argument, effectively removing the keyword arguments. This change makes a copy of the dict before --- diff --git a/koji/__init__.py b/koji/__init__.py index 9d44488..f8156ae 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -439,8 +439,8 @@ def decode_args(*args): if len(args) > 0: last = args[-1] if isinstance(last, dict) and last.get('__starstar', False): - del last['__starstar'] - opts = last + opts = last.copy() + del opts['__starstar'] args = args[:-1] return args, opts