)]}'
{"ceilometer/coordination.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"3173fa76d161e21bfdc4f31f3bbf53a11b356e10","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            hr \u003d utils.HashRing(members)"},{"line_number":225,"context_line":"            iterable \u003d list(iterable)"},{"line_number":226,"context_line":"            filtered \u003d [v for v in iterable"},{"line_number":227,"context_line":"                        if hr.get_node(str(v).encode(\u0027utf-8\u0027)) \u003d\u003d self._my_id]"},{"line_number":228,"context_line":"            LOG.debug(\u0027The universal set: %s, my subset: %s\u0027,"},{"line_number":229,"context_line":"                      [str(f) for f in iterable], [str(f) for f in filtered])"},{"line_number":230,"context_line":"            return filtered"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_161ed8ba","line":227,"updated":"2016-09-12 21:57:57.000000000","message":"if you replace str with  six.text_type does it work?","commit_id":"739617c30083912d335079b594ea3cdce481384d"},{"author":{"_account_id":22752,"name":"Hanxi Liu","email":"apolloliuhx@gmail.com","username":"Hanxi_Liu"},"change_message_id":"6c159725613de8b1c7c7177f07795a3dfeff84a9","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            hr \u003d utils.HashRing(members)"},{"line_number":225,"context_line":"            iterable \u003d list(iterable)"},{"line_number":226,"context_line":"            filtered \u003d [v for v in iterable"},{"line_number":227,"context_line":"                        if hr.get_node(str(v).encode(\u0027utf-8\u0027)) \u003d\u003d self._my_id]"},{"line_number":228,"context_line":"            LOG.debug(\u0027The universal set: %s, my subset: %s\u0027,"},{"line_number":229,"context_line":"                      [str(f) for f in iterable], [str(f) for f in filtered])"},{"line_number":230,"context_line":"            return filtered"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_8ea727a6","line":227,"in_reply_to":"9a89bdaa_161ed8ba","updated":"2016-09-13 04:51:14.000000000","message":"good suggestion! Actually, use encode direct is also a good way to this bug. six.text_type is the better choice.","commit_id":"739617c30083912d335079b594ea3cdce481384d"}],"ceilometer/utils.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"77360ae5a01e5e7649d71c4231f5a7e0e25ab081","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # the tuple would become list. So we have to generate the value as"},{"line_number":77,"context_line":"        # list here."},{"line_number":78,"context_line":"        return [decode_unicode(element) for element in input]"},{"line_number":79,"context_line":"    elif six.PY2 and isinstance(input, six.text_type):"},{"line_number":80,"context_line":"        return input.encode(\u0027utf-8\u0027)"},{"line_number":81,"context_line":"    elif six.PY3 and isinstance(input, six.binary_type):"},{"line_number":82,"context_line":"        return input.decode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_f5356ca8","side":"PARENT","line":79,"updated":"2016-09-19 16:46:57.000000000","message":"do we really need to remove this? if it\u0027s py3, it\u0027s already unicode so we shouldn\u0027t need to encode.","commit_id":"976d8b4931fd9037e73c123e91ee12f390885b18"},{"author":{"_account_id":22752,"name":"Hanxi Liu","email":"apolloliuhx@gmail.com","username":"Hanxi_Liu"},"change_message_id":"6cd51033a1489f787e38a589fa1e6b870e414f8b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # the tuple would become list. So we have to generate the value as"},{"line_number":77,"context_line":"        # list here."},{"line_number":78,"context_line":"        return [decode_unicode(element) for element in input]"},{"line_number":79,"context_line":"    elif six.PY2 and isinstance(input, six.text_type):"},{"line_number":80,"context_line":"        return input.encode(\u0027utf-8\u0027)"},{"line_number":81,"context_line":"    elif six.PY3 and isinstance(input, six.binary_type):"},{"line_number":82,"context_line":"        return input.decode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_84c71f97","side":"PARENT","line":79,"in_reply_to":"7a8ec9b2_0eedf0b6","updated":"2016-09-21 14:39:08.000000000","message":"when I use this method, I find the unicode coudn\u0027t be encoded to utf-8 in py3 if there is no change in line 239. So I fix it.","commit_id":"976d8b4931fd9037e73c123e91ee12f390885b18"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"5ec03caaa572c09481a086bb999e30d8dd154a8e","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # the tuple would become list. So we have to generate the value as"},{"line_number":77,"context_line":"        # list here."},{"line_number":78,"context_line":"        return [decode_unicode(element) for element in input]"},{"line_number":79,"context_line":"    elif six.PY2 and isinstance(input, six.text_type):"},{"line_number":80,"context_line":"        return input.encode(\u0027utf-8\u0027)"},{"line_number":81,"context_line":"    elif six.PY3 and isinstance(input, six.binary_type):"},{"line_number":82,"context_line":"        return input.decode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_eb2c36ae","side":"PARENT","line":79,"in_reply_to":"7a8ec9b2_157d78e7","updated":"2016-09-21 12:36:17.000000000","message":"but line 239 will already cast it to unicode, no?","commit_id":"976d8b4931fd9037e73c123e91ee12f390885b18"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"04544e7aa50e3f052d3ffd15fa7bd7455f23a786","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # the tuple would become list. So we have to generate the value as"},{"line_number":77,"context_line":"        # list here."},{"line_number":78,"context_line":"        return [decode_unicode(element) for element in input]"},{"line_number":79,"context_line":"    elif six.PY2 and isinstance(input, six.text_type):"},{"line_number":80,"context_line":"        return input.encode(\u0027utf-8\u0027)"},{"line_number":81,"context_line":"    elif six.PY3 and isinstance(input, six.binary_type):"},{"line_number":82,"context_line":"        return input.decode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_0eedf0b6","side":"PARENT","line":79,"in_reply_to":"7a8ec9b2_eb2c36ae","updated":"2016-09-21 12:42:55.000000000","message":"I don\u0027t think this change is related to the reported bug. But I agreed that this method can currently return a different \u0027type\u0027 depending of the python version and that\u0027s another bug. Perhaps we can split both fixes ? (I will be not worried if we can\u0027t)","commit_id":"976d8b4931fd9037e73c123e91ee12f390885b18"},{"author":{"_account_id":22752,"name":"Hanxi Liu","email":"apolloliuhx@gmail.com","username":"Hanxi_Liu"},"change_message_id":"279668903fb0da2cc08abec9d1f09f13ae56839e","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # the tuple would become list. So we have to generate the value as"},{"line_number":77,"context_line":"        # list here."},{"line_number":78,"context_line":"        return [decode_unicode(element) for element in input]"},{"line_number":79,"context_line":"    elif six.PY2 and isinstance(input, six.text_type):"},{"line_number":80,"context_line":"        return input.encode(\u0027utf-8\u0027)"},{"line_number":81,"context_line":"    elif six.PY3 and isinstance(input, six.binary_type):"},{"line_number":82,"context_line":"        return input.decode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_157d78e7","side":"PARENT","line":79,"in_reply_to":"7a8ec9b2_f5356ca8","updated":"2016-09-19 16:58:52.000000000","message":"in py3, we should encode to utf-8 in case of other character set like \u0027ascii\u0027.","commit_id":"976d8b4931fd9037e73c123e91ee12f390885b18"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"77360ae5a01e5e7649d71c4231f5a7e0e25ab081","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_15d49845","line":239,"updated":"2016-09-19 16:46:57.000000000","message":"this probably isn\u0027t necessary.","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"26a243c0c07a5edf5e80ef5e4dec88cce2b32dad","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_a985d6cf","line":239,"in_reply_to":"7a8ec9b2_09532ae3","updated":"2016-09-21 12:51:46.000000000","message":"yeah, i don\u0027t know where key can be configured. i believed all our coordination keys were just uuid or string constants.","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"},{"author":{"_account_id":22752,"name":"Hanxi Liu","email":"apolloliuhx@gmail.com","username":"Hanxi_Liu"},"change_message_id":"279668903fb0da2cc08abec9d1f09f13ae56839e","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_95ac2837","line":239,"in_reply_to":"7a8ec9b2_15d49845","updated":"2016-09-19 16:58:52.000000000","message":"there are some problems when using str(). In order to be more compatible, we should use six.text_type(). After that, use decode_unicode to ensure string to encode \u0027utf-8\u0027.","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"04544e7aa50e3f052d3ffd15fa7bd7455f23a786","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_4ec298ea","line":239,"in_reply_to":"7a8ec9b2_4b0b6ad6","updated":"2016-09-21 12:42:55.000000000","message":"What surprise me here is why this method can take unicode or bytes as input. This seems to just hide a culprit somewhere else.","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"3dfc8be5258651c9001296bce42e565c0274479a","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_09532ae3","line":239,"in_reply_to":"7a8ec9b2_4ec298ea","updated":"2016-09-21 12:47:05.000000000","message":"To be clear the old code is wrong I agree, but the new one is too gentle with the expected input.","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"5ec03caaa572c09481a086bb999e30d8dd154a8e","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_4b0b6ad6","line":239,"in_reply_to":"7a8ec9b2_95ac2837","updated":"2016-09-21 12:36:17.000000000","message":"ok. do it in one line than \n\n  key \u003d decode_unicode(six.text_type(key))","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"},{"author":{"_account_id":22752,"name":"Hanxi Liu","email":"apolloliuhx@gmail.com","username":"Hanxi_Liu"},"change_message_id":"6cd51033a1489f787e38a589fa1e6b870e414f8b","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    @staticmethod"},{"line_number":238,"context_line":"    def _hash(key):"},{"line_number":239,"context_line":"        key \u003d six.text_type(key)"},{"line_number":240,"context_line":"        key \u003d decode_unicode(key)"},{"line_number":241,"context_line":"        return struct.unpack_from(\u0027\u003eI\u0027,"},{"line_number":242,"context_line":"                                  hashlib.md5(key).digest())[0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_3f0658ce","line":239,"in_reply_to":"7a8ec9b2_a985d6cf","updated":"2016-09-21 14:39:08.000000000","message":"Without this change, str().encode() is encoding string to unicode. But I can\u0027t assure it to be encoded to utf-8. So I take the decode_unicode method.","commit_id":"acc6cd504302abfb63bcd7d384546575f98ba4ca"}]}
