From 74056a0e2834577ad590d023ee73cc20cf103d38 Mon Sep 17 00:00:00 2001 From: panda Date: Fri, 4 Dec 2020 13:38:45 -0800 Subject: [PATCH] Make MessageToDict convert map keys to strings --- python/google/protobuf/json_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/google/protobuf/json_format.py b/python/google/protobuf/json_format.py index c8f5602f36b1..cb91b37a71f0 100644 --- a/python/google/protobuf/json_format.py +++ b/python/google/protobuf/json_format.py @@ -236,7 +236,7 @@ def _RegularMessageToJsonObject(self, message, js): else: recorded_key = 'false' else: - recorded_key = key + recorded_key = str(key) js_map[recorded_key] = self._FieldToJsonObject( v_field, value[key]) js[name] = js_map