)]}'
{"swift/common/memcached.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"da009c1ddc0535f585b6c22b399109921dad7ca5","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def create(self):"},{"line_number":112,"context_line":"        port \u003d DEFAULT_MEMCACHED_PORT"},{"line_number":113,"context_line":"        # IPv6 addresses must be between \u0027[]\u0027"},{"line_number":114,"context_line":"        if self.server.startswith(\u0027[\u0027):"},{"line_number":115,"context_line":"            host_end \u003d self.server.find(\u0027]\u0027)"},{"line_number":116,"context_line":"            if host_end \u003c 0:"},{"line_number":117,"context_line":"                raise ValueError(\u0027Invalid host\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a7e1126_a1568404","line":114,"updated":"2015-12-16 23:52:31.000000000","message":"You might be able to replace all this parsing with something as simple as this (the \"or\" bit to get host is the only awkward part of it):\n\n IP_HOST_RE \u003d re.compile(\u0027^(?:([^[\\]:]+)|\\[(.*)\\])(?::(\\d+))?\u0027)\n ...\n match \u003d IP_HOST_RE.match(self.server)\n if match:\n     host \u003d match.group(1) or match.group(2)\n     port \u003d match.group(3) or DEFAULT_MEMCACHED_PORT\n else:\n     # error handling (which unfortunately is less specific)\n\nIn fact, regardless of whether you take this suggestion, a unit test that just explores the host/port parsing would be nice.  Like break the parsing into a helper method that takes \"self.server\" as input and returns \"(host, port)\" or raises an exception.","commit_id":"0d99c3b38a1421d7ead643a22e8e6454eec68e9d"},{"author":{"_account_id":17363,"name":"Timur Alperovich","email":"timur@timuralp.com","username":"timuralp"},"change_message_id":"e8e558a239fc9f242e7d0baa873a237d0a108530","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def create(self):"},{"line_number":112,"context_line":"        port \u003d DEFAULT_MEMCACHED_PORT"},{"line_number":113,"context_line":"        # IPv6 addresses must be between \u0027[]\u0027"},{"line_number":114,"context_line":"        if self.server.startswith(\u0027[\u0027):"},{"line_number":115,"context_line":"            host_end \u003d self.server.find(\u0027]\u0027)"},{"line_number":116,"context_line":"            if host_end \u003c 0:"},{"line_number":117,"context_line":"                raise ValueError(\u0027Invalid host\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a7e1126_e981d24e","line":114,"in_reply_to":"3a7e1126_a1568404","updated":"2015-12-17 01:19:46.000000000","message":"Partly done. I opted for a mix of approaches with a RE for IPv6 parsing. My concern is that the suggested RE is harder to understand when reading the code in the future. I can change to that if there is a strong preference.\n\nI did factor out the parsing into a helper method with a separate unit test for it.","commit_id":"0d99c3b38a1421d7ead643a22e8e6454eec68e9d"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"da009c1ddc0535f585b6c22b399109921dad7ca5","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        if self.server.startswith(\u0027[\u0027):"},{"line_number":115,"context_line":"            host_end \u003d self.server.find(\u0027]\u0027)"},{"line_number":116,"context_line":"            if host_end \u003c 0:"},{"line_number":117,"context_line":"                raise ValueError(\u0027Invalid host\u0027)"},{"line_number":118,"context_line":"            host \u003d self.server[1:host_end]"},{"line_number":119,"context_line":"            if len(self.server) - 1 \u003e host_end:"},{"line_number":120,"context_line":"                if self.server[host_end + 1] !\u003d \u0027:\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a7e1126_dbb93fee","line":117,"updated":"2015-12-16 23:52:31.000000000","message":"Can you indicate what was wrong with the host?  Like in this case, something like\n\n Invalid host: opening [ with no closing ]\n\nOr something.","commit_id":"0d99c3b38a1421d7ead643a22e8e6454eec68e9d"},{"author":{"_account_id":17363,"name":"Timur Alperovich","email":"timur@timuralp.com","username":"timuralp"},"change_message_id":"e8e558a239fc9f242e7d0baa873a237d0a108530","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        if self.server.startswith(\u0027[\u0027):"},{"line_number":115,"context_line":"            host_end \u003d self.server.find(\u0027]\u0027)"},{"line_number":116,"context_line":"            if host_end \u003c 0:"},{"line_number":117,"context_line":"                raise ValueError(\u0027Invalid host\u0027)"},{"line_number":118,"context_line":"            host \u003d self.server[1:host_end]"},{"line_number":119,"context_line":"            if len(self.server) - 1 \u003e host_end:"},{"line_number":120,"context_line":"                if self.server[host_end + 1] !\u003d \u0027:\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a7e1126_a97bca7a","line":117,"in_reply_to":"3a7e1126_dbb93fee","updated":"2015-12-17 01:19:46.000000000","message":"Done.","commit_id":"0d99c3b38a1421d7ead643a22e8e6454eec68e9d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"092bd52dbf1f9d016a6de16d4be53569c6d2bb2c","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        return (host, port)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def create(self):"},{"line_number":133,"context_line":"        host, port \u003d self._get_addr()"},{"line_number":134,"context_line":"        addrs \u003d socket.getaddrinfo(host, port, socket.AF_UNSPEC,"},{"line_number":135,"context_line":"                                   socket.SOCK_STREAM)"},{"line_number":136,"context_line":"        family, socktype, proto, canonname, sockaddr \u003d addrs[0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_43da0a7a","line":133,"updated":"2016-01-08 03:33:28.000000000","message":"I don\u0027t think this parsing has to be done lazily - we could do it in __init__ and get a better error on misconfig.","commit_id":"f763f37d9516e354b27838482eaf0fbd4846f878"}],"test/unit/common/test_memcached.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"092bd52dbf1f9d016a6de16d4be53569c6d2bb2c","unresolved":false,"context_lines":[{"line_number":591,"context_line":"        finally:"},{"line_number":592,"context_line":"            memcached.MemcacheConnPool \u003d orig_conn_pool"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"    def test_connection_pool_parser(self):"},{"line_number":595,"context_line":"        default \u003d memcached.DEFAULT_MEMCACHED_PORT"},{"line_number":596,"context_line":"        addrs \u003d [(\u00271.2.3.4\u0027, \u00271.2.3.4\u0027, default),"},{"line_number":597,"context_line":"                 (\u00271.2.3.4:5000\u0027, \u00271.2.3.4\u0027, 5000),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_e3bd3e03","line":594,"updated":"2016-01-08 03:33:28.000000000","message":"this is the best test of the lot IMO - KUDOS","commit_id":"f763f37d9516e354b27838482eaf0fbd4846f878"}]}
