)]}'
{"swift/common/memcached.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8e8894b47b3fb369be3724e0e728217f8b7f5e30","unresolved":false,"context_lines":[{"line_number":80,"context_line":"def md5hash(key):"},{"line_number":81,"context_line":"    if isinstance(key, six.text_type):"},{"line_number":82,"context_line":"        key \u003d key.encode(\u0027utf8\u0027)"},{"line_number":83,"context_line":"    return md5(key).hexdigest()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def sanitize_timeout(timeout):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_36c96627","line":83,"updated":"2016-08-22 18:49:13.000000000","message":"Do we ever use md5hash in some context where we aren\u0027t going to immediately turn it into bytes and push it through a socket? Would it be better to just do the .encode(\u0027ascii\u0027) here?","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"4976d8777ba377dba3988767794535a408297c2b","unresolved":false,"context_lines":[{"line_number":80,"context_line":"def md5hash(key):"},{"line_number":81,"context_line":"    if isinstance(key, six.text_type):"},{"line_number":82,"context_line":"        key \u003d key.encode(\u0027utf8\u0027)"},{"line_number":83,"context_line":"    return md5(key).hexdigest()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def sanitize_timeout(timeout):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_c83cabca","line":83,"in_reply_to":"1ac06dbe_36c96627","updated":"2016-08-22 20:16:49.000000000","message":"In short: we need to return Unicode on Python 3 here.\n\nOh, it\u0027s a little bit complex :-) It would be better to always format memcache command as bytes. The problem is that bytes%args was removed from Python 3, but reintroduced in Python 3.5 (PEP 461). To support also Python 3.4, I chose to return Unicode here on Python 3 to to keep formatting as text below:\n\n        cmd \u003d \u0027get %s\\r\\n\u0027 % key\n\nPEP 461: https://docs.python.org/dev/whatsnew/3.5.html#whatsnew-pep-461","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8e8894b47b3fb369be3724e0e728217f8b7f5e30","unresolved":false,"context_lines":[{"line_number":441,"context_line":"                value \u003d json.dumps(value)"},{"line_number":442,"context_line":"                flags |\u003d JSON_FLAG"},{"line_number":443,"context_line":"            msg +\u003d (\u0027set %s %d %d %s\\r\\n%s\\r\\n\u0027 %"},{"line_number":444,"context_line":"                    (key, flags, timeout, len(value), value))"},{"line_number":445,"context_line":"        for (server, fp, sock) in self._get_conns(server_key):"},{"line_number":446,"context_line":"            try:"},{"line_number":447,"context_line":"                with Timeout(self._io_timeout):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_f6c22e33","line":444,"range":{"start_line":444,"start_character":46,"end_line":444,"end_character":51},"updated":"2016-08-22 18:49:13.000000000","message":"If value is unicode, don\u0027t we need to encode it as utf-8 to get the correct len here?","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"4976d8777ba377dba3988767794535a408297c2b","unresolved":false,"context_lines":[{"line_number":441,"context_line":"                value \u003d json.dumps(value)"},{"line_number":442,"context_line":"                flags |\u003d JSON_FLAG"},{"line_number":443,"context_line":"            msg +\u003d (\u0027set %s %d %d %s\\r\\n%s\\r\\n\u0027 %"},{"line_number":444,"context_line":"                    (key, flags, timeout, len(value), value))"},{"line_number":445,"context_line":"        for (server, fp, sock) in self._get_conns(server_key):"},{"line_number":446,"context_line":"            try:"},{"line_number":447,"context_line":"                with Timeout(self._io_timeout):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_e82fe785","line":444,"range":{"start_line":444,"start_character":46,"end_line":444,"end_character":51},"in_reply_to":"1ac06dbe_f6c22e33","updated":"2016-08-22 20:16:49.000000000","message":"Oh, right. It\u0027s an obvious bug. It\u0027s now fixed.\n\nI also added a new _set_cmd() helper function to factorize the code between set() and set_multi(), this method is not so obvious.","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8e8894b47b3fb369be3724e0e728217f8b7f5e30","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                                if six.PY3:"},{"line_number":489,"context_line":"                                    value \u003d value.decode(\u0027utf8\u0027)"},{"line_number":490,"context_line":"                                value \u003d json.loads(value)"},{"line_number":491,"context_line":"                            responses[line[1]] \u003d value"},{"line_number":492,"context_line":"                            fp.readline()"},{"line_number":493,"context_line":"                        line \u003d fp.readline().strip().split()"},{"line_number":494,"context_line":"                    values \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_9cc9595c","line":491,"updated":"2016-08-22 18:49:13.000000000","message":"Should we have something like L322-323 here as well?","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"4976d8777ba377dba3988767794535a408297c2b","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                                if six.PY3:"},{"line_number":489,"context_line":"                                    value \u003d value.decode(\u0027utf8\u0027)"},{"line_number":490,"context_line":"                                value \u003d json.loads(value)"},{"line_number":491,"context_line":"                            responses[line[1]] \u003d value"},{"line_number":492,"context_line":"                            fp.readline()"},{"line_number":493,"context_line":"                        line \u003d fp.readline().strip().split()"},{"line_number":494,"context_line":"                    values \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_489d5bbb","line":491,"in_reply_to":"1ac06dbe_9cc9595c","updated":"2016-08-22 20:16:49.000000000","message":"Oh, this bug was not catched by unit tests. Again, you are right: we must return Unicode, as get().\n\nI also added a new helper method, _read_value(), to factorize the code between get() and get_multi().","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"}],"test/unit/common/test_memcached.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8e8894b47b3fb369be3724e0e728217f8b7f5e30","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                if six.PY3:"},{"line_number":139,"context_line":"                    cmd \u003d cmd.encode(\u0027utf8\u0027)"},{"line_number":140,"context_line":"                self.outbuf +\u003d cmd"},{"line_number":141,"context_line":"                if isinstance(cache_value, six.text_type):"},{"line_number":142,"context_line":"                    cache_value \u003d cache_value.encode(\u0027utf8\u0027)"},{"line_number":143,"context_line":"                self.outbuf +\u003d cache_value + b\u0027\\r\\n\u0027"},{"line_number":144,"context_line":"        self.outbuf +\u003d b\u0027END\\r\\n\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_59aed398","line":141,"range":{"start_line":141,"start_character":30,"end_line":141,"end_character":41},"updated":"2016-08-22 18:49:13.000000000","message":"Would cache_value ever not be bytes? I\u0027m not sure I see why MockMemcached should ever deal with anything besides bytes.\n\nDo we have any tests that set up the cache directly or something? I think I\u0027d view that as a bug.","commit_id":"a4d03a774462d9f22df1e0a656c708c6a19c2240"}]}
