diff --git a/daemon.py b/daemon.py index a50bce011..87825fd28 100644 --- a/daemon.py +++ b/daemon.py @@ -1633,10 +1633,9 @@ class PubServer(BaseHTTPRequestHandler): account_outbox_thread_name + '/' + str(self.server.outbox_thread_index[account_outbox_thread_name])) print('THREAD: _post_to_outbox') - message_json_copy = message_json.copy() self.server.outboxThread[account_outbox_thread_name][index] = \ thread_with_trace(target=self._post_to_outbox, - args=(message_json_copy, + args=(message_json.copy(), self.server.project_version, None, curr_session, proxy_type), daemon=True) diff --git a/posts.py b/posts.py index 30591ebf9..09019cbbe 100644 --- a/posts.py +++ b/posts.py @@ -2495,16 +2495,14 @@ def send_post(signing_priv_key_pem: str, project_version: str, send_threads.pop(0) print('WARN: thread killed') print('THREAD: thread_send_post') - signature_header_json_copy = signature_header_json.copy() - signature_header_json_ld_copy = signature_header_json_ld.copy() thr = \ thread_with_trace(target=thread_send_post, args=(session, post_json_str, federation_list, inbox_url, base_dir, - signature_header_json_copy, - signature_header_json_ld_copy, + signature_header_json.copy(), + signature_header_json_ld.copy(), post_log, debug, http_prefix, domain_full), daemon=True) send_threads.append(thr) @@ -2907,16 +2905,14 @@ def send_signed_json(post_json_object: {}, session, base_dir: str, pprint(post_json_object) domain_full = get_full_domain(domain, port) print('THREAD: thread_send_post 2') - signature_header_json_copy = signature_header_json.copy(), - signature_header_json_ld_copy = signature_header_json_ld.copy(), thr = \ thread_with_trace(target=thread_send_post, args=(session, post_json_str, federation_list, inbox_url, base_dir, - signature_header_json_copy, - signature_header_json_ld_copy, + signature_header_json.copy(), + signature_header_json_ld.copy(), post_log, debug, http_prefix, domain_full), daemon=True) send_threads.append(thr) @@ -3492,7 +3488,6 @@ def send_to_followers_thread(server, session, session_onion, session_i2p, """Returns a thread used to send a post to followers """ print('THREAD: send_to_followers') - post_json_object_copy = post_json_object.copy() send_thread = \ thread_with_trace(target=send_to_followers, args=(server, session, session_onion, session_i2p, @@ -3501,7 +3496,7 @@ def send_to_followers_thread(server, session, session_onion, session_i2p, http_prefix, federation_list, send_threads, post_log, cached_webfingers, person_cache, - post_json_object_copy, debug, + post_json_object.copy(), debug, project_version, shared_items_federated_domains, shared_item_federation_tokens, diff --git a/tests.py b/tests.py index 3ac6ca736..fd0fed64c 100644 --- a/tests.py +++ b/tests.py @@ -4950,10 +4950,10 @@ def _test_thread_functions(): arg_ctr += 1 continue last_arg = False - if '(' in func_arg: + if '(' in func_arg and '()' not in func_arg: func_arg = func_arg.split('(')[1] - if func_arg.endswith(')'): + if func_arg.endswith(')') and '()' not in func_arg: func_arg = func_arg.split(')')[0] last_arg = True func_arg = func_arg.strip()