)]}'
{"swift/common/swob.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"599b5f7675a3bb3e5cba2cbaba8e13be18b6262a","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            string +\u003d \u0027,\u0027"},{"line_number":479,"context_line":"        return string.rstrip(\u0027,\u0027)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def range_for_length(self, length):"},{"line_number":482,"context_line":"        \"\"\""},{"line_number":483,"context_line":"        range_for_length is used to return multiple ranges"},{"line_number":484,"context_line":"        serve from a body, given body length argument and the Range\u0027s ranges."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJSQ%3D","line":481,"updated":"2012-10-11 16:41:54.000000000","message":"Should this method be called ranges_for_length() now?","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"599b5f7675a3bb3e5cba2cbaba8e13be18b6262a","unresolved":false,"context_lines":[{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def range_for_length(self, length):"},{"line_number":482,"context_line":"        \"\"\""},{"line_number":483,"context_line":"        range_for_length is used to return multiple ranges"},{"line_number":484,"context_line":"        serve from a body, given body length argument and the Range\u0027s ranges."},{"line_number":485,"context_line":"        this method returns all valid ranges under the given length"},{"line_number":486,"context_line":"        if any of the range is invalid, it returns None by following"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJSI%3D","line":483,"updated":"2012-10-11 16:41:54.000000000","message":"The \"to\" was lost.  Should probably read, \"return multiple ranges to server from a body...\"","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"599b5f7675a3bb3e5cba2cbaba8e13be18b6262a","unresolved":false,"context_lines":[{"line_number":482,"context_line":"        \"\"\""},{"line_number":483,"context_line":"        range_for_length is used to return multiple ranges"},{"line_number":484,"context_line":"        serve from a body, given body length argument and the Range\u0027s ranges."},{"line_number":485,"context_line":"        this method returns all valid ranges under the given length"},{"line_number":486,"context_line":"        if any of the range is invalid, it returns None by following"},{"line_number":487,"context_line":"        HTTP range spec so that the response will return the entire body"},{"line_number":488,"context_line":"        instead of returning specific content range."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJSA%3D","line":485,"updated":"2012-10-11 16:41:54.000000000","message":"These sentences need a little cleanup.  Perhaps:\n\nThis method returns all valid ranges under the given length.  If any range is invalid, it returns None according to the HTTP spec (the Range header will be ignored and the response will return the entire body).","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"2fa827478a5b2deb4556d72bde3aa61a997dcb3a","unresolved":false,"context_lines":[{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def ranges_for_length(self, length):"},{"line_number":482,"context_line":"        \"\"\""},{"line_number":483,"context_line":"        this method is used to return multiple ranges for a given length"},{"line_number":484,"context_line":"        which should represent the length of the underlying content."},{"line_number":485,"context_line":"        if an invalid range is found, the method will return None. if all"},{"line_number":486,"context_line":"        the ranges are valid, this method returns an array of ranges, each"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FJC8%3D","line":483,"updated":"2012-10-11 20:51:42.000000000","message":"It\u0027s a nitpick, but this (good) comment would read more easily with proper capitalization.","commit_id":"12f3c2453075aa8fec1c19d4b6629a590fd321d2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"2fa827478a5b2deb4556d72bde3aa61a997dcb3a","unresolved":false,"context_lines":[{"line_number":847,"context_line":"                    start, end \u003d args[0]"},{"line_number":848,"context_line":"                    self.content_length \u003d (end - start)"},{"line_number":849,"context_line":"                    return app_iter.app_iter_range(start, end)"},{"line_number":850,"context_line":"                elif (app_iter and hasattr(app_iter, \u0027app_iter_ranges\u0027) and"},{"line_number":851,"context_line":"                      len(args) \u003e 1):"},{"line_number":852,"context_line":"                    # At this point, we do not know the length"},{"line_number":853,"context_line":"                    self.content_length \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FJDE%3D","line":850,"updated":"2012-10-11 20:51:42.000000000","message":"lines 853-862 are missing unit test coverage; can you make sure those get exercised?","commit_id":"12f3c2453075aa8fec1c19d4b6629a590fd321d2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":804,"context_line":""},{"line_number":805,"context_line":"    def _multi_range_iter(self, app_iter, ranges, content_type):"},{"line_number":806,"context_line":"        \"\"\""},{"line_number":807,"context_line":"        This method is a generator which uses app_iter_range to get the"},{"line_number":808,"context_line":"        chunk as comes in from app_iter_range, then base64 encoding the"},{"line_number":809,"context_line":"        content piece by piece, original chunk will need to be segmented"},{"line_number":810,"context_line":"        into multiples of 57 character length."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI6s%3D","line":807,"updated":"2012-10-12 00:24:08.000000000","message":"It uses app_iter_ranges(), not app_iter_range (ditto one line down) in this docstring).","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":804,"context_line":""},{"line_number":805,"context_line":"    def _multi_range_iter(self, app_iter, ranges, content_type):"},{"line_number":806,"context_line":"        \"\"\""},{"line_number":807,"context_line":"        This method is a generator which uses app_iter_range to get the"},{"line_number":808,"context_line":"        chunk as comes in from app_iter_range, then base64 encoding the"},{"line_number":809,"context_line":"        content piece by piece, original chunk will need to be segmented"},{"line_number":810,"context_line":"        into multiples of 57 character length."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI4w%3D","line":807,"in_reply_to":"AAAALH%2F%2FI6s%3D","updated":"2012-10-12 00:59:34.000000000","message":"will make that change.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":850,"context_line":"                elif (app_iter and hasattr(app_iter, \u0027app_iter_ranges\u0027) and"},{"line_number":851,"context_line":"                      len(args) \u003e 1):"},{"line_number":852,"context_line":"                    # At this point, we do not know the length"},{"line_number":853,"context_line":"                    self.content_length \u003d None"},{"line_number":854,"context_line":"                    object_content_type \u003d self.content_type"},{"line_number":855,"context_line":"                    # the new content type will be multipart/mixed"},{"line_number":856,"context_line":"                    # also need to add the boundary string"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI7E%3D","line":853,"updated":"2012-10-12 00:24:08.000000000","message":"Missing unit test coverage of lines 853-862.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"4d57e70247ab459cd7db5d4dd222030d6bbf87d2","unresolved":false,"context_lines":[{"line_number":850,"context_line":"                elif (app_iter and hasattr(app_iter, \u0027app_iter_ranges\u0027) and"},{"line_number":851,"context_line":"                      len(args) \u003e 1):"},{"line_number":852,"context_line":"                    # At this point, we do not know the length"},{"line_number":853,"context_line":"                    self.content_length \u003d None"},{"line_number":854,"context_line":"                    object_content_type \u003d self.content_type"},{"line_number":855,"context_line":"                    # the new content type will be multipart/mixed"},{"line_number":856,"context_line":"                    # also need to add the boundary string"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI1U%3D","line":853,"in_reply_to":"AAAALH%2F%2FI4o%3D","updated":"2012-10-12 08:39:14.000000000","message":"Is there a bug in whatever tool is generating (line) test coverage metrics when running \"./.unittests\"?  According to that (nosecoverage?), those lines are not exercised by unit tests.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":850,"context_line":"                elif (app_iter and hasattr(app_iter, \u0027app_iter_ranges\u0027) and"},{"line_number":851,"context_line":"                      len(args) \u003e 1):"},{"line_number":852,"context_line":"                    # At this point, we do not know the length"},{"line_number":853,"context_line":"                    self.content_length \u003d None"},{"line_number":854,"context_line":"                    object_content_type \u003d self.content_type"},{"line_number":855,"context_line":"                    # the new content type will be multipart/mixed"},{"line_number":856,"context_line":"                    # also need to add the boundary string"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI4o%3D","line":853,"in_reply_to":"AAAALH%2F%2FI7E%3D","updated":"2012-10-12 00:59:34.000000000","message":"no, as I replied in the earlier patch, it is covered by test case test_multi_range_body in test_swob.py","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":863,"context_line":"                                                  object_content_type)"},{"line_number":864,"context_line":"                elif app_iter:"},{"line_number":865,"context_line":"                    # this could be improved, but we don\u0027t actually use it"},{"line_number":866,"context_line":"                    content \u003d \u0027\u0027.join(app_iter)"},{"line_number":867,"context_line":"                    return [content[start:end] for (start, end) in args]"},{"line_number":868,"context_line":"                elif body:"},{"line_number":869,"context_line":"                    return [body[start:end] for (start, end) in args]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI6M%3D","line":866,"updated":"2012-10-12 00:24:08.000000000","message":"Is it true that if you did a GET with a Range header with two or more ranges to a segmented object, you would concatenate all segments into RAM here (the content variable)?  Since segmented objects are often large, that seems like a good way to blow up a proxy with a user request...","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"4d57e70247ab459cd7db5d4dd222030d6bbf87d2","unresolved":false,"context_lines":[{"line_number":863,"context_line":"                                                  object_content_type)"},{"line_number":864,"context_line":"                elif app_iter:"},{"line_number":865,"context_line":"                    # this could be improved, but we don\u0027t actually use it"},{"line_number":866,"context_line":"                    content \u003d \u0027\u0027.join(app_iter)"},{"line_number":867,"context_line":"                    return [content[start:end] for (start, end) in args]"},{"line_number":868,"context_line":"                elif body:"},{"line_number":869,"context_line":"                    return [body[start:end] for (start, end) in args]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FIxQ%3D","line":866,"in_reply_to":"AAAALH%2F%2FI5Y%3D","updated":"2012-10-12 08:39:14.000000000","message":"You could:\n\n1) disallow this case (\"lie\" and return 416/empty-body)\n\n2) implement app_iter_ranges() in SegmentedIterable (possibly with restrictions like all ranges must be in order of appearing bytes with no overlap, or whatever).\n\n3) call app_iter_range with the first start/end pair\n\n4) something else I can\u0027t think of, but which doesn\u0027t have this pull-it-into-RAM effect\n\n#1 is probably the cheapest.  #2 would give you the most flexibility in solving the problem (possibly actually implementing the spec).  #3 is a close runner up to #1 for being the cheapest, with slightly better behavior.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":863,"context_line":"                                                  object_content_type)"},{"line_number":864,"context_line":"                elif app_iter:"},{"line_number":865,"context_line":"                    # this could be improved, but we don\u0027t actually use it"},{"line_number":866,"context_line":"                    content \u003d \u0027\u0027.join(app_iter)"},{"line_number":867,"context_line":"                    return [content[start:end] for (start, end) in args]"},{"line_number":868,"context_line":"                elif body:"},{"line_number":869,"context_line":"                    return [body[start:end] for (start, end) in args]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI5Y%3D","line":866,"in_reply_to":"AAAALH%2F%2FI6M%3D","updated":"2012-10-12 00:59:34.000000000","message":"what is your suggestion?","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"9d5b886d96077a56e76f9b69d90c9bf0d859f045","unresolved":false,"context_lines":[{"line_number":863,"context_line":"                                                  object_content_type)"},{"line_number":864,"context_line":"                elif app_iter:"},{"line_number":865,"context_line":"                    # this could be improved, but we don\u0027t actually use it"},{"line_number":866,"context_line":"                    content \u003d \u0027\u0027.join(app_iter)"},{"line_number":867,"context_line":"                    return [content[start:end] for (start, end) in args]"},{"line_number":868,"context_line":"                elif body:"},{"line_number":869,"context_line":"                    return [body[start:end] for (start, end) in args]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FIso%3D","line":866,"in_reply_to":"AAAALH%2F%2FIxQ%3D","updated":"2012-10-12 12:57:09.000000000","message":"right, that is what I thought, not seeing an easy way otherwise. As I indicated\nearlier, join was what was there before this patch. and some one already\nindicated that is not used as the code comment. I can look into this, I very much like this patch to go in and add that later.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3029075b6c4f2d7a2fb44c6d3381fb3edccf91f","unresolved":false,"context_lines":[{"line_number":524,"context_line":"        if len(all_ranges) \u003e\u003d 1:"},{"line_number":525,"context_line":"            return all_ranges"},{"line_number":526,"context_line":"        else:"},{"line_number":527,"context_line":"            return None"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"class Match(object):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FIR4%3D","line":527,"updated":"2012-10-12 21:25:42.000000000","message":"Looks like line 527 is missing test coverage.","commit_id":"c44491bb5357981e2910ebcb518c1a813c219aa1"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3029075b6c4f2d7a2fb44c6d3381fb3edccf91f","unresolved":false,"context_lines":[{"line_number":850,"context_line":"                elif (app_iter and hasattr(app_iter, \u0027app_iter_ranges\u0027) and"},{"line_number":851,"context_line":"                      len(args) \u003e 1):"},{"line_number":852,"context_line":"                    # At this point, we do not know the length"},{"line_number":853,"context_line":"                    self.content_length \u003d None"},{"line_number":854,"context_line":"                    object_content_type \u003d self.content_type"},{"line_number":855,"context_line":"                    # the new content type will be multipart/mixed"},{"line_number":856,"context_line":"                    # also need to add the boundary string"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FIR0%3D","line":853,"updated":"2012-10-12 21:25:42.000000000","message":"Hrm, it still looks like 853 to 862 don\u0027t have unit test coverage.  Note that unit testing _multi_range_iter() itself doesn\u0027t cover this plumbing code here.","commit_id":"c44491bb5357981e2910ebcb518c1a813c219aa1"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"002b251a1842195cf198cefb6e78f9c78b4a39ce","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        add the bottom boundary"},{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        section_header \u003d \u0027\u0027.join([\u0027\\r\\n--\u0027, self.boundary, \u0027\\r\\n\u0027,"},{"line_number":822,"context_line":"            \u0027Content-Type:\u0027, content_type, \u0027\\r\\n\\r\\n\u0027])"},{"line_number":823,"context_line":"        for chunk in app_iter.app_iter_ranges(ranges, section_header):"},{"line_number":824,"context_line":"            yield chunk"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F%2BYs%3D","line":821,"updated":"2012-10-23 21:11:02.000000000","message":"Does this need to include Content-Range in addition to Content-Type?  See http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2\n\n(Though note that Swift may not be setting Content-Range on responses for a single range, which I think the RFC also specifies... so it would at least be consistent to not do it here either...)","commit_id":"5c5c5053dcd4a021c7d11221ba78108bc3ecc474"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"3bc0d961fa5673da079b4f41b42eb98bc3c542ea","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        add the bottom boundary"},{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        section_header \u003d \u0027\u0027.join([\u0027\\r\\n--\u0027, self.boundary, \u0027\\r\\n\u0027,"},{"line_number":822,"context_line":"            \u0027Content-Type:\u0027, content_type, \u0027\\r\\n\\r\\n\u0027])"},{"line_number":823,"context_line":"        for chunk in app_iter.app_iter_ranges(ranges, section_header):"},{"line_number":824,"context_line":"            yield chunk"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F%2BG0%3D","line":821,"in_reply_to":"AAAALn%2F%2F%2BYs%3D","updated":"2012-10-24 04:18:53.000000000","message":"Done","commit_id":"5c5c5053dcd4a021c7d11221ba78108bc3ecc474"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"002b251a1842195cf198cefb6e78f9c78b4a39ce","unresolved":false,"context_lines":[{"line_number":832,"context_line":"                self.request.range and self.request.range.ranges and \\"},{"line_number":833,"context_line":"                not self.content_range:"},{"line_number":834,"context_line":"            args \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":835,"context_line":"            if not args:"},{"line_number":836,"context_line":"                self.status \u003d 416"},{"line_number":837,"context_line":"                self.content_length \u003d 0"},{"line_number":838,"context_line":"                return [\u0027\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F%2BaU%3D","line":835,"updated":"2012-10-23 21:11:02.000000000","message":"Now that you\u0027ve got a \"fall-through\" catch below which sets status to 416, content_length to 0, and returns an empty body, can you change this logic block to something like:\n\n if args:\n     ...\n \u003c416 handling code\u003e\n\nThat will avoid the duplicated code.","commit_id":"5c5c5053dcd4a021c7d11221ba78108bc3ecc474"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"3bc0d961fa5673da079b4f41b42eb98bc3c542ea","unresolved":false,"context_lines":[{"line_number":832,"context_line":"                self.request.range and self.request.range.ranges and \\"},{"line_number":833,"context_line":"                not self.content_range:"},{"line_number":834,"context_line":"            args \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":835,"context_line":"            if not args:"},{"line_number":836,"context_line":"                self.status \u003d 416"},{"line_number":837,"context_line":"                self.content_length \u003d 0"},{"line_number":838,"context_line":"                return [\u0027\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F%2BWk%3D","line":835,"in_reply_to":"AAAALn%2F%2F%2BaU%3D","updated":"2012-10-24 04:18:53.000000000","message":"sure","commit_id":"5c5c5053dcd4a021c7d11221ba78108bc3ecc474"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"a80bfc0bc1e330eb68f9bc5e995eb50e16483d6f","unresolved":false,"context_lines":[{"line_number":840,"context_line":"                                                     \u0027boundary\u003d\u0027,"},{"line_number":841,"context_line":"                                                     self.boundary])"},{"line_number":842,"context_line":"                        # setup MIME-Version to be 1.0"},{"line_number":843,"context_line":"                        self.headers[\u0027MIME-Version\u0027] \u003d \u00271.0\u0027"},{"line_number":844,"context_line":"                        return app_iter.app_iter_ranges(args,"},{"line_number":845,"context_line":"                                                        content_type,"},{"line_number":846,"context_line":"                                                        self.boundary,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F8RQ%3D","line":843,"updated":"2012-10-25 19:48:49.000000000","message":"Is the response \"in full compliance with the MIME protocol (as defined in RFC 2045[7])\"?  If not, this header shouldn\u0027t be set.  See http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.4.1","commit_id":"9e6ec53748deb4a024db92ff432f5aa661993e40"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"9850710beeb6a66ce488c323cbb2862ea7335dbe","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        content_size \u003d self.content_length"},{"line_number":834,"context_line":"        content_type \u003d self.content_type"},{"line_number":835,"context_line":"        self.content_length \u003d None"},{"line_number":836,"context_line":"        self.content_type \u003d \u0027\u0027.join([\u0027multipart/byteranges;\u0027,"},{"line_number":837,"context_line":"                                        \u0027boundary\u003d\u0027,"},{"line_number":838,"context_line":"                                        self.boundary])"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7SE%3D","line":835,"updated":"2012-10-26 18:23:44.000000000","message":"You can just set \"self.content_length\" to the computed body_size value in this method and not return it.\n\nI.e. remove this line, and assign to self.content_length later in this method after body_size has been computed.  Then don\u0027t return it and remove the assignments to self.content_length by the callers of _prepare_for_ranges().","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ee7d0f4514f870a36f9449c8201add3e9dabad26","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        content_size \u003d self.content_length"},{"line_number":834,"context_line":"        content_type \u003d self.content_type"},{"line_number":835,"context_line":"        self.content_length \u003d None"},{"line_number":836,"context_line":"        self.content_type \u003d \u0027\u0027.join([\u0027multipart/byteranges;\u0027,"},{"line_number":837,"context_line":"                                        \u0027boundary\u003d\u0027,"},{"line_number":838,"context_line":"                                        self.boundary])"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7Og%3D","line":835,"in_reply_to":"AAAALn%2F%2F7SE%3D","updated":"2012-10-26 19:54:40.000000000","message":"Done","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        self.body \u003d body"},{"line_number":819,"context_line":"        self.app_iter \u003d app_iter"},{"line_number":820,"context_line":"        self.status \u003d status"},{"line_number":821,"context_line":"        self.boundary \u003d os.urandom(16).encode(\u0027hex\u0027)"},{"line_number":822,"context_line":"        if request:"},{"line_number":823,"context_line":"            self.environ \u003d request.environ"},{"line_number":824,"context_line":"            if request.range and self.status \u003d\u003d 200:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5bU%3D","line":821,"updated":"2012-10-30 01:16:56.000000000","message":"Why not use Python\u0027s built-in PRNG with something like the following?\n\n\"%x\" % random.randint(0, 256**16)\n\n(This isn\u0027t an objection, just a question. I\u0027m simply curious.)","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"562cd90c91841e23d1f2b0a2bcdb57dd0b937f21","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        self.body \u003d body"},{"line_number":819,"context_line":"        self.app_iter \u003d app_iter"},{"line_number":820,"context_line":"        self.status \u003d status"},{"line_number":821,"context_line":"        self.boundary \u003d os.urandom(16).encode(\u0027hex\u0027)"},{"line_number":822,"context_line":"        if request:"},{"line_number":823,"context_line":"            self.environ \u003d request.environ"},{"line_number":824,"context_line":"            if request.range and self.status \u003d\u003d 200:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F4f0%3D","line":821,"in_reply_to":"AAAALn%2F%2F4mc%3D","updated":"2012-10-30 20:36:10.000000000","message":"I will use the random.randint() as you suggested.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"71936798dc3ff5cf1bea88146d5700ad0137822a","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        self.body \u003d body"},{"line_number":819,"context_line":"        self.app_iter \u003d app_iter"},{"line_number":820,"context_line":"        self.status \u003d status"},{"line_number":821,"context_line":"        self.boundary \u003d os.urandom(16).encode(\u0027hex\u0027)"},{"line_number":822,"context_line":"        if request:"},{"line_number":823,"context_line":"            self.environ \u003d request.environ"},{"line_number":824,"context_line":"            if request.range and self.status \u003d\u003d 200:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F4mc%3D","line":821,"in_reply_to":"AAAALn%2F%2F5JE%3D","updated":"2012-10-30 18:36:51.000000000","message":"os.urandom() pulls bytes out of /dev/urandom for crypto-grade randomness.\n\nrandom.randint() uses Python\u0027s built-in pseudorandom number generator, which is considered to be a good PRNG, but the randomness is typically not considered strong enough for cryptographic applications.\n\nSince this is just making a boundary between parts of a response, it doesn\u0027t have to be crypto-grade randomness. The ordinary stuff from the built-in PRNG will do.\n\nHowever, if you want to leave this as os.urandom(), I won\u0027t object.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        self.body \u003d body"},{"line_number":819,"context_line":"        self.app_iter \u003d app_iter"},{"line_number":820,"context_line":"        self.status \u003d status"},{"line_number":821,"context_line":"        self.boundary \u003d os.urandom(16).encode(\u0027hex\u0027)"},{"line_number":822,"context_line":"        if request:"},{"line_number":823,"context_line":"            self.environ \u003d request.environ"},{"line_number":824,"context_line":"            if request.range and self.status \u003d\u003d 200:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5JE%3D","line":821,"in_reply_to":"AAAALn%2F%2F5bU%3D","updated":"2012-10-30 13:40:24.000000000","message":"Sam, did not know that can do the same thing. Is it better than os random\nencode? or it is actually using it?","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":865,"context_line":"        if self.conditional_response and self.request and \\"},{"line_number":866,"context_line":"                self.request.range and self.request.range.ranges and \\"},{"line_number":867,"context_line":"                not self.content_range:"},{"line_number":868,"context_line":"            args \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":869,"context_line":"            range_size \u003d len(args)"},{"line_number":870,"context_line":"            if range_size \u003e 0:"},{"line_number":871,"context_line":"                \"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5bE%3D","line":868,"updated":"2012-10-30 01:16:56.000000000","message":"I don\u0027t like the variable name \"args\" here. I\u0027d much prefer something descriptive like \"ranges\".\n\nI know that it was named \"args\" before, but it wasn\u0027t a good name then either (IMHO). Now that it\u0027s used in more places, I think it would aid readability to rename the variable to something meaningful.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":865,"context_line":"        if self.conditional_response and self.request and \\"},{"line_number":866,"context_line":"                self.request.range and self.request.range.ranges and \\"},{"line_number":867,"context_line":"                not self.content_range:"},{"line_number":868,"context_line":"            args \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":869,"context_line":"            range_size \u003d len(args)"},{"line_number":870,"context_line":"            if range_size \u003e 0:"},{"line_number":871,"context_line":"                \"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5JA%3D","line":868,"in_reply_to":"AAAALn%2F%2F5bE%3D","updated":"2012-10-30 13:40:24.000000000","message":"Done","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":876,"context_line":"                self.content_range \u003d self.request.range"},{"line_number":877,"context_line":"                if range_size \u003d\u003d 1:"},{"line_number":878,"context_line":"                    start, end \u003d args[0]"},{"line_number":879,"context_line":"                    if start is None and end is None:"},{"line_number":880,"context_line":"                        #syntactically valid, but not satisfiable"},{"line_number":881,"context_line":"                        pass"},{"line_number":882,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5aY%3D","line":879,"updated":"2012-10-30 01:16:56.000000000","message":"Does this case happen any more? I think the filtering in swob.Range.__init__ makes this branch unnecessary.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":876,"context_line":"                self.content_range \u003d self.request.range"},{"line_number":877,"context_line":"                if range_size \u003d\u003d 1:"},{"line_number":878,"context_line":"                    start, end \u003d args[0]"},{"line_number":879,"context_line":"                    if start is None and end is None:"},{"line_number":880,"context_line":"                        #syntactically valid, but not satisfiable"},{"line_number":881,"context_line":"                        pass"},{"line_number":882,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5IQ%3D","line":879,"in_reply_to":"AAAALn%2F%2F5aY%3D","updated":"2012-10-30 13:40:24.000000000","message":"Yes, there are two cases, one is to return 200, one is to return 416, this is to make sure that these two cases can be distinguished. This is based on not \nchanging the existing range code (again trying to change as little existing \ncode) as possible. I am planning to change the range code, so this probably \nwon\u0027t be necessary, but I need to look.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"26e527b6c487fb0d624e99f6d04b125d458f45ed","unresolved":false,"context_lines":[{"line_number":904,"context_line":"                                                    content_size,"},{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F498%3D","line":907,"updated":"2012-10-30 15:21:51.000000000","message":"This comment is actually intended for an implicit \"else\" for the immediately-preceding if/elif block.  Maybe this could all be made more clear by making that else block explicit and associating the comment with it:\n\n else:\n     # Even though there may be valid ranges in the request,\n     # app_iter_ranges() has not been implemented on the app_iter\n     # which is required for multi-range support (or a static\n     # body).\n     pass","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":904,"context_line":"                                                    content_size,"},{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5ak%3D","line":907,"updated":"2012-10-30 01:16:56.000000000","message":"Typo: you want \"though\", not \"through\".\n\nAlso, it should be \"request, neither\"","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":904,"context_line":"                                                    content_size,"},{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5IM%3D","line":907,"in_reply_to":"AAAALn%2F%2F5ak%3D","updated":"2012-10-30 13:40:24.000000000","message":"Done","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""},{"line_number":911,"context_line":"                self.status \u003d 416"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5ac%3D","line":908,"updated":"2012-10-30 01:16:56.000000000","message":"ITYM \"can\", not \"can not\".","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"562cd90c91841e23d1f2b0a2bcdb57dd0b937f21","unresolved":false,"context_lines":[{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""},{"line_number":911,"context_line":"                self.status \u003d 416"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F4fs%3D","line":908,"in_reply_to":"AAAALn%2F%2F4mU%3D","updated":"2012-10-30 20:36:10.000000000","message":"Yes, when I was changing the code, I noticed that problem, it is now fixed. Using neither a nor b can satisfy blabla.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"71936798dc3ff5cf1bea88146d5700ad0137822a","unresolved":false,"context_lines":[{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""},{"line_number":911,"context_line":"                self.status \u003d 416"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F4mU%3D","line":908,"in_reply_to":"AAAALn%2F%2F5H4%3D","updated":"2012-10-30 18:36:51.000000000","message":"Yep. The comment says \"Neither app_iter or body can not satisfy...\", which is a double negative. Removing the word \"not\" fixes it.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":905,"context_line":"                                                    _body_slicer)"},{"line_number":906,"context_line":"                \"\"\""},{"line_number":907,"context_line":"                Even through there are valid ranges in the request. Neither"},{"line_number":908,"context_line":"                app_iter or body can not satisfy the request, so set the"},{"line_number":909,"context_line":"                status to be 416"},{"line_number":910,"context_line":"                \"\"\""},{"line_number":911,"context_line":"                self.status \u003d 416"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5H4%3D","line":908,"in_reply_to":"AAAALn%2F%2F5ac%3D","updated":"2012-10-30 13:40:24.000000000","message":"hmmm, when we reach this point, that means the request can not be satisfied, so we are returning 416.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    Every syntactically valid range will be added into the ranges list"},{"line_number":459,"context_line":"    even when some of the ranges may not be satisfied by underlying content."},{"line_number":460,"context_line":"    It is important to note that the only cases at this point can not be"},{"line_number":461,"context_line":"    determined if the range is satisfiable or not are the following cases:"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    1. bytes\u003d30-50, when content is less than 30 bytes long"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4Lk%3D","line":460,"updated":"2012-10-31 05:21:01.000000000","message":"I understand the first sentence of this paragraph, but I\u0027m not sure what the rest of the paragraph and the numbered list are trying to say.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    Every syntactically valid range will be added into the ranges list"},{"line_number":459,"context_line":"    even when some of the ranges may not be satisfied by underlying content."},{"line_number":460,"context_line":"    It is important to note that the only cases at this point can not be"},{"line_number":461,"context_line":"    determined if the range is satisfiable or not are the following cases:"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    1. bytes\u003d30-50, when content is less than 30 bytes long"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3yo%3D","line":460,"in_reply_to":"AAAALn%2F%2F4Lk%3D","updated":"2012-10-31 14:57:38.000000000","message":"It says that the cases listed below at this point have to be considered as valid. Only when the content length is given later, these ranges can be determined if they are valid or not.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        all_ranges \u003d []"},{"line_number":540,"context_line":"        for single_range in self.ranges:"},{"line_number":541,"context_line":"            begin, end \u003d single_range"},{"line_number":542,"context_line":"            \"\"\""},{"line_number":543,"context_line":"            The possible values for begin and end are"},{"line_number":544,"context_line":"            None, 0, or a positive numeric number"},{"line_number":545,"context_line":"            \"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4MA%3D","line":542,"updated":"2012-10-31 05:21:01.000000000","message":"Can you make this a comment instead of a multi-line string?  I\u0027m pretty sure that should only be used for \"docstrings\" not comments inline with code like this.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        all_ranges \u003d []"},{"line_number":540,"context_line":"        for single_range in self.ranges:"},{"line_number":541,"context_line":"            begin, end \u003d single_range"},{"line_number":542,"context_line":"            \"\"\""},{"line_number":543,"context_line":"            The possible values for begin and end are"},{"line_number":544,"context_line":"            None, 0, or a positive numeric number"},{"line_number":545,"context_line":"            \"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3yc%3D","line":542,"in_reply_to":"AAAALn%2F%2F4MA%3D","updated":"2012-10-31 14:57:38.000000000","message":"Done","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    all_ranges.append((begin, length))"},{"line_number":559,"context_line":"                else:"},{"line_number":560,"context_line":"                    # the begin position is greater than the content length"},{"line_number":561,"context_line":"                    return []"},{"line_number":562,"context_line":"            # end can only be 0 or numeric value"},{"line_number":563,"context_line":"            elif begin \u003c\u003d length:"},{"line_number":564,"context_line":"                # the begin position is valid, take the min of end + 1 or"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4Lo%3D","line":561,"updated":"2012-10-31 05:21:01.000000000","message":"I think some or all of these \"return []\" statements should just be \"continue\".\n\nFor syntactically invalid byte-range-sets, it only takes one apple to spoil the whole bunch.  But for satisfiable/unsatisfiable, all specified ranges have to be unsatisfiable for 416 to be returned.\n\n If a syntactically valid byte-range-set includes AT LEAST ONE\n byte-range-spec whose first-byte-pos is less than the current\n length of the entity-body, or at least one suffix-byte-range-spec\n with a non- zero suffix-length, then the byte-range-set is\n satisfiable.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    all_ranges.append((begin, length))"},{"line_number":559,"context_line":"                else:"},{"line_number":560,"context_line":"                    # the begin position is greater than the content length"},{"line_number":561,"context_line":"                    return []"},{"line_number":562,"context_line":"            # end can only be 0 or numeric value"},{"line_number":563,"context_line":"            elif begin \u003c\u003d length:"},{"line_number":564,"context_line":"                # the begin position is valid, take the min of end + 1 or"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3yY%3D","line":561,"in_reply_to":"AAAALn%2F%2F4Lo%3D","updated":"2012-10-31 14:57:38.000000000","message":"No, this is what we have discussed, if there is one syntactically bad, entire\nrange is considered bad, please see the apache2 cases. The current behavior is same as apache2. The begin position is greater than the content length is considered syntactically invalid. There is a paragraph in the spec specifically talked about it. There are only two return [] in this section of code. They both imply the same case.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":823,"context_line":"    for start, stop in ranges:"},{"line_number":824,"context_line":"        yield \u0027\u0027.join([\u0027\\r\\n--\u0027, boundary, \u0027\\r\\n\u0027,"},{"line_number":825,"context_line":"                    \u0027Content-Type: \u0027, content_type, \u0027\\r\\n\u0027])"},{"line_number":826,"context_line":"        range_str \u003d \u0027Content-Range: bytes \u0027"},{"line_number":827,"context_line":"        if start or start \u003d\u003d 0:"},{"line_number":828,"context_line":"            range_str +\u003d str(start) + \u0027-\u0027"},{"line_number":829,"context_line":"        if stop is not None:"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4LQ%3D","line":826,"updated":"2012-10-31 05:21:01.000000000","message":"I think you can refactor out the construction of the Content-Range header.  This logic appears 3 different times: once here, and twice in _response_iter below.  Something like this perhaps:\n\n def content_range_header(start, stop, size):\n     range_str \u003d \u0027Content-Range: bytes \u0027\n     ...\n     return range_str\n\nThen here, the usage would be\n\n yield content_range_header(start, stop, size)","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":823,"context_line":"    for start, stop in ranges:"},{"line_number":824,"context_line":"        yield \u0027\u0027.join([\u0027\\r\\n--\u0027, boundary, \u0027\\r\\n\u0027,"},{"line_number":825,"context_line":"                    \u0027Content-Type: \u0027, content_type, \u0027\\r\\n\u0027])"},{"line_number":826,"context_line":"        range_str \u003d \u0027Content-Range: bytes \u0027"},{"line_number":827,"context_line":"        if start or start \u003d\u003d 0:"},{"line_number":828,"context_line":"            range_str +\u003d str(start) + \u0027-\u0027"},{"line_number":829,"context_line":"        if stop is not None:"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3xo%3D","line":826,"in_reply_to":"AAAALn%2F%2F4LQ%3D","updated":"2012-10-31 14:57:38.000000000","message":"Done","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":918,"context_line":"                    if range_size \u003d\u003d 1:"},{"line_number":919,"context_line":"                        start, end \u003d ranges[0]"},{"line_number":920,"context_line":"                        if app_iter and hasattr(app_iter, \u0027app_iter_range\u0027):"},{"line_number":921,"context_line":"                            self.content_range \u003d \u0027\u0027.join([\u0027bytes \u0027, str(start),"},{"line_number":922,"context_line":"                                \u0027-\u0027, str(end - 1), \u0027/\u0027,"},{"line_number":923,"context_line":"                                str(self.content_length)])"},{"line_number":924,"context_line":"                            self.content_length \u003d (end - start)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4LE%3D","line":921,"updated":"2012-10-31 05:21:01.000000000","message":"See above comment for proposed refactoring of Content-Range header construction.  Usage here would look like\n\n self.content_range \u003d content_range_header(start, end, self.content_length)","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":918,"context_line":"                    if range_size \u003d\u003d 1:"},{"line_number":919,"context_line":"                        start, end \u003d ranges[0]"},{"line_number":920,"context_line":"                        if app_iter and hasattr(app_iter, \u0027app_iter_range\u0027):"},{"line_number":921,"context_line":"                            self.content_range \u003d \u0027\u0027.join([\u0027bytes \u0027, str(start),"},{"line_number":922,"context_line":"                                \u0027-\u0027, str(end - 1), \u0027/\u0027,"},{"line_number":923,"context_line":"                                str(self.content_length)])"},{"line_number":924,"context_line":"                            self.content_length \u003d (end - start)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3xk%3D","line":921,"in_reply_to":"AAAALn%2F%2F4LE%3D","updated":"2012-10-31 14:57:38.000000000","message":"Done","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":924,"context_line":"                            self.content_length \u003d (end - start)"},{"line_number":925,"context_line":"                            return app_iter.app_iter_range(start, end)"},{"line_number":926,"context_line":"                        elif body:"},{"line_number":927,"context_line":"                            self.content_range \u003d \u0027\u0027.join([\u0027bytes \u0027, str(start),"},{"line_number":928,"context_line":"                                \u0027-\u0027, str(end - 1), \u0027/\u0027,"},{"line_number":929,"context_line":"                                str(self.content_length)])"},{"line_number":930,"context_line":"                            self.content_length \u003d (end - start)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4LI%3D","line":927,"updated":"2012-10-31 05:21:01.000000000","message":"See above comment for proposed refactoring of Content-Range header construction.  Usage here would look like\n\n self.content_range \u003d content_range_header(start, end, self.content_length)","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":924,"context_line":"                            self.content_length \u003d (end - start)"},{"line_number":925,"context_line":"                            return app_iter.app_iter_range(start, end)"},{"line_number":926,"context_line":"                        elif body:"},{"line_number":927,"context_line":"                            self.content_range \u003d \u0027\u0027.join([\u0027bytes \u0027, str(start),"},{"line_number":928,"context_line":"                                \u0027-\u0027, str(end - 1), \u0027/\u0027,"},{"line_number":929,"context_line":"                                str(self.content_length)])"},{"line_number":930,"context_line":"                            self.content_length \u003d (end - start)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3xg%3D","line":927,"in_reply_to":"AAAALn%2F%2F4LI%3D","updated":"2012-10-31 14:57:38.000000000","message":"Done","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f3151768d66caf2290ae3ad7a309e50865a4183a","unresolved":false,"context_lines":[{"line_number":947,"context_line":"                                                        self.boundary,"},{"line_number":948,"context_line":"                                                        content_size,"},{"line_number":949,"context_line":"                                                        _body_slicer)"},{"line_number":950,"context_line":"                \"\"\""},{"line_number":951,"context_line":"                Even though there are valid ranges in the request, neither"},{"line_number":952,"context_line":"                app_iter nor body can satisfy the request, so set the"},{"line_number":953,"context_line":"                status to be 416"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F4Lc%3D","line":950,"updated":"2012-10-31 05:21:01.000000000","message":"You can reach this point (the 416-setting code) under two conditions: ranges is \"falsy\" (eg. empty) or because you had a segmented iterable which manifests as an app_iter object which does not implement app_iter_ranges() and no body. (I guess technically you could also reach it if you had only one range, but somehow had an app_iter which did not implement app_iter_range(), but that can\u0027t currently happen--that\u0027s the old branch which had a comment saying it would never be reached in Swift.)\n\nBecause of that, this comment isn\u0027t accurate, where it\u0027s placed.  This comment really belongs with the implicit \"else\" block immediately above it.  (I commented to this effect on the last patchset.)\n\nAfter the \"elif body:\" block, you could add\n\n else:\n     # Even though there are valid ranges...\n\nAlso please change that comment to a comment, not a multi-line string inline with code.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"e5f78b3e439ee5fbc1fb1018530f28019384afe6","unresolved":false,"context_lines":[{"line_number":947,"context_line":"                                                        self.boundary,"},{"line_number":948,"context_line":"                                                        content_size,"},{"line_number":949,"context_line":"                                                        _body_slicer)"},{"line_number":950,"context_line":"                \"\"\""},{"line_number":951,"context_line":"                Even though there are valid ranges in the request, neither"},{"line_number":952,"context_line":"                app_iter nor body can satisfy the request, so set the"},{"line_number":953,"context_line":"                status to be 416"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3p8%3D","line":950,"in_reply_to":"AAAALn%2F%2F3xY%3D","updated":"2012-10-31 15:08:02.000000000","message":"Darrell, the logic here is correct. when ranges list is None, that means\nsyntactically invalid, 200 returns, then when list is not None but empty, this is the case 416 should be returned. Also in the cases the range list is not empty,\nbut there is no app_iter_range or app_iter_ranges defined by the object, these cases also will have to return 416 since there is no implementation to meet\nthe requested ranges. The current implementation is correct after I checked the code again. So the previous response Done is not correct.","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"bab816b9b94c0c0e9facdeee614e0c27c90be4d7","unresolved":false,"context_lines":[{"line_number":947,"context_line":"                                                        self.boundary,"},{"line_number":948,"context_line":"                                                        content_size,"},{"line_number":949,"context_line":"                                                        _body_slicer)"},{"line_number":950,"context_line":"                \"\"\""},{"line_number":951,"context_line":"                Even though there are valid ranges in the request, neither"},{"line_number":952,"context_line":"                app_iter nor body can satisfy the request, so set the"},{"line_number":953,"context_line":"                status to be 416"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAALn%2F%2F3xY%3D","line":950,"in_reply_to":"AAAALn%2F%2F4Lc%3D","updated":"2012-10-31 14:57:38.000000000","message":"Done","commit_id":"e453862b62b134a6b3c43cff1afcb4a274d2a15c"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"0bedb12fa677a251eb5e6e727c13caef4ba9e25d","unresolved":false,"context_lines":[{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    Every syntactically valid range will be added into the ranges list"},{"line_number":459,"context_line":"    even when some of the ranges may not be satisfied by underlying content."},{"line_number":460,"context_line":"    It is important to note that the only cases at this point can not be"},{"line_number":461,"context_line":"    determined if the range is satisfiable or not are the following cases:"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    1. bytes\u003d30-50, when content is less than 30 bytes long"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F3ZM%3D","line":460,"updated":"2012-10-31 18:17:00.000000000","message":"I think you can just cut out lines 460-465, here.  Based on your reply to my earlier comment, I don\u0027t think they add anything to this first sentence (which is good and clear).  The extra exposition only serves to confuse (at least to me).","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ba03b64204f95fec98919d094787e83ec1b4ce50","unresolved":false,"context_lines":[{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    Every syntactically valid range will be added into the ranges list"},{"line_number":459,"context_line":"    even when some of the ranges may not be satisfied by underlying content."},{"line_number":460,"context_line":"    It is important to note that the only cases at this point can not be"},{"line_number":461,"context_line":"    determined if the range is satisfiable or not are the following cases:"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    1. bytes\u003d30-50, when content is less than 30 bytes long"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F28w%3D","line":460,"in_reply_to":"AAAALn%2F%2F3ZM%3D","updated":"2012-11-01 00:06:40.000000000","message":"Done","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"0bedb12fa677a251eb5e6e727c13caef4ba9e25d","unresolved":false,"context_lines":[{"line_number":556,"context_line":"                    all_ranges.append((begin, length))"},{"line_number":557,"context_line":"                else:"},{"line_number":558,"context_line":"                    # the begin position is greater than the content length"},{"line_number":559,"context_line":"                    return []"},{"line_number":560,"context_line":"            # end can only be 0 or numeric value"},{"line_number":561,"context_line":"            elif begin \u003c\u003d length:"},{"line_number":562,"context_line":"                # the begin position is valid, take the min of end + 1 or"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F3X8%3D","line":559,"updated":"2012-10-31 18:17:00.000000000","message":"I fear I\u0027m having trouble communicating.  The RFC draws a distinction between \"syntactically invalid\" and \"unsatisfiable\".  Please reread it, looking for how those two phrases are used.\n\nIf I have a 100 byte object, and I send\n\n Range: bytes\u003d101-\n\nI should get back a 416, *not* a 200.  That range in my example *IS* syntactically valid.  It matches the grammar and the 2nd number is \u003e\u003d the first.  So it\u0027s syntactically valid.\n\nThen the RFC goes on to state,\n\n If a syntactically valid byte-range-set includes at least one\n byte-range-spec whose first-byte-pos is less than the\n current length of the entity-body..., then the byte-range-set\n is satisfiable.\n\n Otherwise, the byte-range-set is unsatisfiable. If the\n byte-range-set is unsatisfiable, the server SHOULD return a\n response with a status of 416 (Requested range not satisfiable).\n\nThe RFC is clear on what the server should do in the case of my above example.  The server should return a status of 416.","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ba03b64204f95fec98919d094787e83ec1b4ce50","unresolved":false,"context_lines":[{"line_number":556,"context_line":"                    all_ranges.append((begin, length))"},{"line_number":557,"context_line":"                else:"},{"line_number":558,"context_line":"                    # the begin position is greater than the content length"},{"line_number":559,"context_line":"                    return []"},{"line_number":560,"context_line":"            # end can only be 0 or numeric value"},{"line_number":561,"context_line":"            elif begin \u003c\u003d length:"},{"line_number":562,"context_line":"                # the begin position is valid, take the min of end + 1 or"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F28s%3D","line":559,"in_reply_to":"AAAALn%2F%2F3X8%3D","updated":"2012-11-01 00:06:40.000000000","message":"Done","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"0bedb12fa677a251eb5e6e727c13caef4ba9e25d","unresolved":false,"context_lines":[{"line_number":564,"context_line":"                all_ranges.append((begin, min(end + 1, length)))"},{"line_number":565,"context_line":"            else:"},{"line_number":566,"context_line":"                # the begin position is greater than the content length"},{"line_number":567,"context_line":"                return []"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        return all_ranges"},{"line_number":570,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F3WM%3D","line":567,"updated":"2012-10-31 18:17:00.000000000","message":"An example for why this should be \"continue\" is:\n\n Range: bytes\u003d101-106\n\nThat\u0027s still syntactically-valid but unsatisfiable.","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ba03b64204f95fec98919d094787e83ec1b4ce50","unresolved":false,"context_lines":[{"line_number":564,"context_line":"                all_ranges.append((begin, min(end + 1, length)))"},{"line_number":565,"context_line":"            else:"},{"line_number":566,"context_line":"                # the begin position is greater than the content length"},{"line_number":567,"context_line":"                return []"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        return all_ranges"},{"line_number":570,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F28o%3D","line":567,"in_reply_to":"AAAALn%2F%2F3WM%3D","updated":"2012-11-01 00:06:40.000000000","message":"Done","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"0bedb12fa677a251eb5e6e727c13caef4ba9e25d","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    if value_only:"},{"line_number":830,"context_line":"        return range_str + \u0027/\u0027 + str(size)"},{"line_number":831,"context_line":"    else:"},{"line_number":832,"context_line":"        return range_str + \u0027/\u0027 + str(size) + \u0027\\r\\n\\r\\n\u0027"},{"line_number":833,"context_line":""},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"def multi_range_iterator(ranges, content_type, boundary, size, sub_iter_gen):"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F3VI%3D","line":832,"updated":"2012-10-31 18:17:00.000000000","message":"Returning two sets of CRLF will end headers.  It\u0027s probably better to only include one set of CRLF here and make multi_range_iterator do\n\n yield content_range_header(...) + \u0027\\r\\n\u0027","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ba03b64204f95fec98919d094787e83ec1b4ce50","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    if value_only:"},{"line_number":830,"context_line":"        return range_str + \u0027/\u0027 + str(size)"},{"line_number":831,"context_line":"    else:"},{"line_number":832,"context_line":"        return range_str + \u0027/\u0027 + str(size) + \u0027\\r\\n\\r\\n\u0027"},{"line_number":833,"context_line":""},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"def multi_range_iterator(ranges, content_type, boundary, size, sub_iter_gen):"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAALn%2F%2F28k%3D","line":832,"in_reply_to":"AAAALn%2F%2F3VI%3D","updated":"2012-11-01 00:06:40.000000000","message":"Also need to use this method to generate value only. so keep what I have here.","commit_id":"c2fa4c1010bb3f1192e3f0b5bd189bec5a36bdb7"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"81e416e6d9913751c45098dbc234e0bbdc9bbe1a","unresolved":false,"context_lines":[{"line_number":822,"context_line":"    if value_only:"},{"line_number":823,"context_line":"        return range_str + \u0027/\u0027 + str(size)"},{"line_number":824,"context_line":"    else:"},{"line_number":825,"context_line":"        return range_str + \u0027/\u0027 + str(size) + \u0027\\r\\n\\r\\n\u0027"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":""},{"line_number":828,"context_line":"def multi_range_iterator(ranges, content_type, boundary, size, sub_iter_gen):"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAALn%2F%2F27g%3D","line":825,"updated":"2012-11-01 00:34:46.000000000","message":"I still think this (one) line should read:\n\n         return range_str + \u0027/\u0027 + str(size) + \u0027\\r\\n\u0027\n\nThis method shouldn\u0027t need to know or care if it\u0027s the last header (and only the last header should have \"\\r\\n\\r\\n\" after it.  When value_only is False, the returned string should be only one header, ending in one \"\\r\\n\".\n\nThe caller of this method should be responsible for ending headers (with a final \"\\r\\n\").\n\n(This has nothing to do with the case where value_only\u003dTrue.)","commit_id":"6ee7d77b2b9ff5cc59d548a82e0a86449bc787fb"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"feb33945417069605f135b1bc99c33a9e8aa1729","unresolved":false,"context_lines":[{"line_number":822,"context_line":"    if value_only:"},{"line_number":823,"context_line":"        return range_str + \u0027/\u0027 + str(size)"},{"line_number":824,"context_line":"    else:"},{"line_number":825,"context_line":"        return range_str + \u0027/\u0027 + str(size) + \u0027\\r\\n\\r\\n\u0027"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":""},{"line_number":828,"context_line":"def multi_range_iterator(ranges, content_type, boundary, size, sub_iter_gen):"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAALn%2F%2F26w%3D","line":825,"in_reply_to":"AAAALn%2F%2F27g%3D","updated":"2012-11-01 01:00:26.000000000","message":"why would I want to add extra \u0027\\r\\n\u0027 for the value of a header? this method generate a small string, which will be used to set up content-range header. in that case, I do not need extra \u0027\\r\\n\u0027. it is only needed in section header. but I can refactor it so that it will look better.","commit_id":"6ee7d77b2b9ff5cc59d548a82e0a86449bc787fb"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"81e416e6d9913751c45098dbc234e0bbdc9bbe1a","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    for start, stop in ranges:"},{"line_number":830,"context_line":"        yield \u0027\u0027.join([\u0027\\r\\n--\u0027, boundary, \u0027\\r\\n\u0027,"},{"line_number":831,"context_line":"                       \u0027Content-Type: \u0027, content_type, \u0027\\r\\n\u0027])"},{"line_number":832,"context_line":"        yield content_range_header(start, stop, size, False)"},{"line_number":833,"context_line":"        sub_iter \u003d sub_iter_gen(start, stop)"},{"line_number":834,"context_line":"        for chunk in sub_iter:"},{"line_number":835,"context_line":"            yield chunk"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAALn%2F%2F27c%3D","line":832,"updated":"2012-11-01 00:34:46.000000000","message":"...and then this line should read:\n\n         yield content_range_header(start, stop, size, False) + \u0027\\r\\n\u0027","commit_id":"6ee7d77b2b9ff5cc59d548a82e0a86449bc787fb"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"feb33945417069605f135b1bc99c33a9e8aa1729","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    for start, stop in ranges:"},{"line_number":830,"context_line":"        yield \u0027\u0027.join([\u0027\\r\\n--\u0027, boundary, \u0027\\r\\n\u0027,"},{"line_number":831,"context_line":"                       \u0027Content-Type: \u0027, content_type, \u0027\\r\\n\u0027])"},{"line_number":832,"context_line":"        yield content_range_header(start, stop, size, False)"},{"line_number":833,"context_line":"        sub_iter \u003d sub_iter_gen(start, stop)"},{"line_number":834,"context_line":"        for chunk in sub_iter:"},{"line_number":835,"context_line":"            yield chunk"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAALn%2F%2F26s%3D","line":832,"in_reply_to":"AAAALn%2F%2F27c%3D","updated":"2012-11-01 01:00:26.000000000","message":"I understand what you are saying but I do not think that is necessary. Doing that actually added two extra characters to the header. I would not want to do that.","commit_id":"6ee7d77b2b9ff5cc59d548a82e0a86449bc787fb"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"39e642a9760400f2e60637f044db2f39f50a6617","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                    # skip and move on to the next range"},{"line_number":555,"context_line":"                    continue"},{"line_number":556,"context_line":"            # end can only be 0 or numeric value"},{"line_number":557,"context_line":"            elif begin \u003c\u003d length:"},{"line_number":558,"context_line":"                # the begin position is valid, take the min of end + 1 or"},{"line_number":559,"context_line":"                # the total length of the content"},{"line_number":560,"context_line":"                all_ranges.append((begin, min(end + 1, length)))"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAALn%2F%2F2w0%3D","line":557,"updated":"2012-11-01 06:20:11.000000000","message":"I think this should be \"begin \u003c length\".\n\nA 50-byte object has bytes numbered 0, 1, 2, ..., 49. Therefore, a range starting with byte 50 is unsatisfiable.","commit_id":"74287f5365ba90c80ae92f4b8021450432eae3ff"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"a6e04ff7b93c8d10faa69ea2b242dd8ceb1e4fb7","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                    # skip and move on to the next range"},{"line_number":555,"context_line":"                    continue"},{"line_number":556,"context_line":"            # end can only be 0 or numeric value"},{"line_number":557,"context_line":"            elif begin \u003c\u003d length:"},{"line_number":558,"context_line":"                # the begin position is valid, take the min of end + 1 or"},{"line_number":559,"context_line":"                # the total length of the content"},{"line_number":560,"context_line":"                all_ranges.append((begin, min(end + 1, length)))"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAALn%2F%2F2jo%3D","line":557,"in_reply_to":"AAAALn%2F%2F2w0%3D","updated":"2012-11-01 12:16:10.000000000","message":"Done","commit_id":"74287f5365ba90c80ae92f4b8021450432eae3ff"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"dafc298e13754ee74b6db65b66cfcc788923412a","unresolved":false,"context_lines":[{"line_number":511,"context_line":"        are unsatisfiable ranges found in the Range header, 416 will be"},{"line_number":512,"context_line":"        returned."},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        if a list returned with at least one element, it indicates that"},{"line_number":515,"context_line":"        there is at least one range valid and the server should serve the"},{"line_number":516,"context_line":"        request with 206 returned."},{"line_number":517,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2RM%3D","line":514,"updated":"2012-11-01 16:52:27.000000000","message":"Should be\n\n If a list returns with at least one...\n\n(capitalization and verb tense)","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"3b24becb7da10c51f9b53e73c199ccbeb73f1568","unresolved":false,"context_lines":[{"line_number":511,"context_line":"        are unsatisfiable ranges found in the Range header, 416 will be"},{"line_number":512,"context_line":"        returned."},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        if a list returned with at least one element, it indicates that"},{"line_number":515,"context_line":"        there is at least one range valid and the server should serve the"},{"line_number":516,"context_line":"        request with 206 returned."},{"line_number":517,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F1ug%3D","line":514,"in_reply_to":"AAAALn%2F%2F2RM%3D","updated":"2012-11-02 00:43:21.000000000","message":"Done","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"dafc298e13754ee74b6db65b66cfcc788923412a","unresolved":false,"context_lines":[{"line_number":517,"context_line":""},{"line_number":518,"context_line":"        The start value of each range represents the starting position in"},{"line_number":519,"context_line":"        the content, the end value represents the ending position. This"},{"line_number":520,"context_line":"        method purposely added 1 to the end number because the spec requires"},{"line_number":521,"context_line":"        that the Range is inclusive."},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"        The Range spec can be found at the following link:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2RE%3D","line":520,"updated":"2012-11-01 16:52:27.000000000","message":"Should be\n\n ...method purposely adds 1 to the end...","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"3b24becb7da10c51f9b53e73c199ccbeb73f1568","unresolved":false,"context_lines":[{"line_number":517,"context_line":""},{"line_number":518,"context_line":"        The start value of each range represents the starting position in"},{"line_number":519,"context_line":"        the content, the end value represents the ending position. This"},{"line_number":520,"context_line":"        method purposely added 1 to the end number because the spec requires"},{"line_number":521,"context_line":"        that the Range is inclusive."},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"        The Range spec can be found at the following link:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F1uc%3D","line":520,"in_reply_to":"AAAALn%2F%2F2RE%3D","updated":"2012-11-02 00:43:21.000000000","message":"Done","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"dafc298e13754ee74b6db65b66cfcc788923412a","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                if begin \u003c length:"},{"line_number":551,"context_line":"                    all_ranges.append((begin, length))"},{"line_number":552,"context_line":"                else:"},{"line_number":553,"context_line":"                    # the begin position is greater than the content length"},{"line_number":554,"context_line":"                    # skip and move on to the next range"},{"line_number":555,"context_line":"                    continue"},{"line_number":556,"context_line":"            # end can only be 0 or numeric value"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2Q4%3D","line":553,"updated":"2012-11-01 16:52:27.000000000","message":"Should be\n\n # The begin position is greater than or equal to the content\n # length; skip and move on to the next range","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"3b24becb7da10c51f9b53e73c199ccbeb73f1568","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                if begin \u003c length:"},{"line_number":551,"context_line":"                    all_ranges.append((begin, length))"},{"line_number":552,"context_line":"                else:"},{"line_number":553,"context_line":"                    # the begin position is greater than the content length"},{"line_number":554,"context_line":"                    # skip and move on to the next range"},{"line_number":555,"context_line":"                    continue"},{"line_number":556,"context_line":"            # end can only be 0 or numeric value"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F1uM%3D","line":553,"in_reply_to":"AAAALn%2F%2F2Q4%3D","updated":"2012-11-02 00:43:21.000000000","message":"Done","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"dafc298e13754ee74b6db65b66cfcc788923412a","unresolved":false,"context_lines":[{"line_number":902,"context_line":"                not self.content_range:"},{"line_number":903,"context_line":"            ranges \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":904,"context_line":"            if ranges \u003d\u003d []:"},{"line_number":905,"context_line":"                self.status \u003d 416"},{"line_number":906,"context_line":"                self.content_length \u003d 0"},{"line_number":907,"context_line":"                return [\u0027\u0027]"},{"line_number":908,"context_line":"            elif ranges:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2PU%3D","line":905,"updated":"2012-11-01 16:52:27.000000000","message":"Moving the 416 code up here regressed the case of multi-range get against a segmented object.\n\nThe current behavior with this patch is 200 with all bytes of object.\n\nThe desired behavior is 416 with 0 bytes (the \"fast fail\" we talked about having until SegmentedIterable implements app_iter_ranges())","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"3b24becb7da10c51f9b53e73c199ccbeb73f1568","unresolved":false,"context_lines":[{"line_number":902,"context_line":"                not self.content_range:"},{"line_number":903,"context_line":"            ranges \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":904,"context_line":"            if ranges \u003d\u003d []:"},{"line_number":905,"context_line":"                self.status \u003d 416"},{"line_number":906,"context_line":"                self.content_length \u003d 0"},{"line_number":907,"context_line":"                return [\u0027\u0027]"},{"line_number":908,"context_line":"            elif ranges:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F1tY%3D","line":905,"in_reply_to":"AAAALn%2F%2F2NA%3D","updated":"2012-11-02 00:43:21.000000000","message":"Not only because of that reason though. swob is also being used by proxy\nserver, the proxy server provided app_iter may not have either app_iter_range or\napp_iter_ranges at all, proxy can not really at this time to simply return 416, it has to hand over the request to object server. Returning 200 is actually appropriate.","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"3aa252fff23e1d29a6c586f32d4f59e57dc64e47","unresolved":false,"context_lines":[{"line_number":902,"context_line":"                not self.content_range:"},{"line_number":903,"context_line":"            ranges \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":904,"context_line":"            if ranges \u003d\u003d []:"},{"line_number":905,"context_line":"                self.status \u003d 416"},{"line_number":906,"context_line":"                self.content_length \u003d 0"},{"line_number":907,"context_line":"                return [\u0027\u0027]"},{"line_number":908,"context_line":"            elif ranges:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2LM%3D","line":905,"in_reply_to":"AAAALn%2F%2F2NA%3D","updated":"2012-11-01 18:16:02.000000000","message":"The optionality of the Range header is in RFC2616 section 14.35.2 paragraphs 2 and 3, FWIW.","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"a0b0d845d4db8a00712238f840cd649fe45a821e","unresolved":false,"context_lines":[{"line_number":902,"context_line":"                not self.content_range:"},{"line_number":903,"context_line":"            ranges \u003d self.request.range.ranges_for_length(self.content_length)"},{"line_number":904,"context_line":"            if ranges \u003d\u003d []:"},{"line_number":905,"context_line":"                self.status \u003d 416"},{"line_number":906,"context_line":"                self.content_length \u003d 0"},{"line_number":907,"context_line":"                return [\u0027\u0027]"},{"line_number":908,"context_line":"            elif ranges:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2NA%3D","line":905,"in_reply_to":"AAAALn%2F%2F2PU%3D","updated":"2012-11-01 17:16:50.000000000","message":"Hrm... Sam pointed out that the Range header is optional (servers \"MAY\" ignore it).  So returning 200 + whole object for segmented objects is a valid punt (i.e. not violating the standard, where returning a 416 would have been a deliberate violation).\n\nIn light of that, I\u0027m okay with multi-range requests against segmented objects returning 200, so I retract my complaint here :)\n\nYou\u0027re still planning on implementing multi-range support for segmented objects, right?  Sam also pointed out there, that it\u0027s okay for the server to return the requested ranges in a different order.  So Swift should order the ranges and return them in first-byte order.  It should also probably return 200 if any of the ranges overlap (as a punt because implementing that could consume excessive server resources).","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"dafc298e13754ee74b6db65b66cfcc788923412a","unresolved":false,"context_lines":[{"line_number":908,"context_line":"            elif ranges:"},{"line_number":909,"context_line":"                range_size \u003d len(ranges)"},{"line_number":910,"context_line":"                if range_size \u003e 0:"},{"line_number":911,"context_line":"                    #There is at least one valid range in the request, so try"},{"line_number":912,"context_line":"                    #to meet the request"},{"line_number":913,"context_line":"                    if range_size \u003d\u003d 1:"},{"line_number":914,"context_line":"                        start, end \u003d ranges[0]"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAALn%2F%2F2Qw%3D","line":911,"updated":"2012-11-01 16:52:27.000000000","message":"These should have spaces after the \"#\"","commit_id":"96658efffbcaaafc22d9124db4ba1d53890a8453"}],"swift/obj/server.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def app_iter_ranges(self, ranges, range_header, encode\u003dFalse):"},{"line_number":207,"context_line":"        \"\"\"Returns an iterator over the data file a set of ranges\"\"\""},{"line_number":208,"context_line":"        if (not ranges or len(ranges) \u003d\u003d 0):"},{"line_number":209,"context_line":"            yield \u0027\u0027"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"            def check_range(pos):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI7o%3D","line":209,"updated":"2012-10-12 00:24:08.000000000","message":"Missing unit test coverage for line 209.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def app_iter_ranges(self, ranges, range_header, encode\u003dFalse):"},{"line_number":207,"context_line":"        \"\"\"Returns an iterator over the data file a set of ranges\"\"\""},{"line_number":208,"context_line":"        if (not ranges or len(ranges) \u003d\u003d 0):"},{"line_number":209,"context_line":"            yield \u0027\u0027"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"            def check_range(pos):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI44%3D","line":209,"in_reply_to":"AAAALH%2F%2FI7o%3D","updated":"2012-10-12 00:59:34.000000000","message":"yeah, can add one for it.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                    if encode_all:"},{"line_number":231,"context_line":"                        return base64.encodestring(leftover + chunk), \u0027\u0027"},{"line_number":232,"context_line":"                    else:"},{"line_number":233,"context_line":"                        rows \u003d (len(leftover) + len(chunk)) / 57"},{"line_number":234,"context_line":"                        length_to_read \u003d rows * 57 - len(leftover)"},{"line_number":235,"context_line":"                        new_leftover \u003d chunk[length_to_read:]"},{"line_number":236,"context_line":"                        new_content \u003d base64.encodestring(\u0027\u0027.join([leftover,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI7k%3D","line":233,"updated":"2012-10-12 00:24:08.000000000","message":"Missing test coverage for lines 233-238.  This seems particularly interesting because of the \"57 characters\" logic.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"9d5b886d96077a56e76f9b69d90c9bf0d859f045","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                    if encode_all:"},{"line_number":231,"context_line":"                        return base64.encodestring(leftover + chunk), \u0027\u0027"},{"line_number":232,"context_line":"                    else:"},{"line_number":233,"context_line":"                        rows \u003d (len(leftover) + len(chunk)) / 57"},{"line_number":234,"context_line":"                        length_to_read \u003d rows * 57 - len(leftover)"},{"line_number":235,"context_line":"                        new_leftover \u003d chunk[length_to_read:]"},{"line_number":236,"context_line":"                        new_content \u003d base64.encodestring(\u0027\u0027.join([leftover,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FIsk%3D","line":233,"in_reply_to":"AAAALH%2F%2FI1Y%3D","updated":"2012-10-12 12:57:09.000000000","message":"A test case has been added in the latest patch to address that, basically a bigger file (about 10 * chunk size), then build up the response by calling that method, parsed the response and md5() producing the hash, then doing the comparison, it is there now, should cover that\nDone","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"4d57e70247ab459cd7db5d4dd222030d6bbf87d2","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                    if encode_all:"},{"line_number":231,"context_line":"                        return base64.encodestring(leftover + chunk), \u0027\u0027"},{"line_number":232,"context_line":"                    else:"},{"line_number":233,"context_line":"                        rows \u003d (len(leftover) + len(chunk)) / 57"},{"line_number":234,"context_line":"                        length_to_read \u003d rows * 57 - len(leftover)"},{"line_number":235,"context_line":"                        new_leftover \u003d chunk[length_to_read:]"},{"line_number":236,"context_line":"                        new_content \u003d base64.encodestring(\u0027\u0027.join([leftover,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI1Y%3D","line":233,"in_reply_to":"AAAALH%2F%2FI5A%3D","updated":"2012-10-12 08:39:14.000000000","message":"I think notmyname made a number of Swift \"limits\" more configurable, so perhaps the chunk size can be stubbed out to be smaller and more tractable (would still need to be \u003e 57 though?)","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                    if encode_all:"},{"line_number":231,"context_line":"                        return base64.encodestring(leftover + chunk), \u0027\u0027"},{"line_number":232,"context_line":"                    else:"},{"line_number":233,"context_line":"                        rows \u003d (len(leftover) + len(chunk)) / 57"},{"line_number":234,"context_line":"                        length_to_read \u003d rows * 57 - len(leftover)"},{"line_number":235,"context_line":"                        new_leftover \u003d chunk[length_to_read:]"},{"line_number":236,"context_line":"                        new_content \u003d base64.encodestring(\u0027\u0027.join([leftover,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI5A%3D","line":233,"in_reply_to":"AAAALH%2F%2FI7k%3D","updated":"2012-10-12 00:59:34.000000000","message":"yeah, need a big file which is bigger than the chunk and a range has to be also bigger than the chunk size to test 238.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                        yield range_header"},{"line_number":262,"context_line":"                        length \u003d check_range(range_index)"},{"line_number":263,"context_line":"                        continue"},{"line_number":264,"context_line":"                    new_content, leftover \u003d _handle_content(leftover, chunk)"},{"line_number":265,"context_line":"                    yield new_content"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    def _handle_close_quarantine(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI7c%3D","line":264,"updated":"2012-10-12 00:24:08.000000000","message":"Missing unit test coverage for lines 264-265.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                        yield range_header"},{"line_number":262,"context_line":"                        length \u003d check_range(range_index)"},{"line_number":263,"context_line":"                        continue"},{"line_number":264,"context_line":"                    new_content, leftover \u003d _handle_content(leftover, chunk)"},{"line_number":265,"context_line":"                    yield new_content"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    def _handle_close_quarantine(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI48%3D","line":264,"in_reply_to":"AAAALH%2F%2FI7c%3D","updated":"2012-10-12 00:59:34.000000000","message":"same thing as above comment. will add one.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"}],"test/unit/common/test_swob.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"d163321caf714ac31cb86e8267a41793a74b6882","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def test_range_for_length_no_start(self):"},{"line_number":138,"context_line":"        range \u003d swift.common.swob.Range(\u0027bytes\u003d-7\u0027)"},{"line_number":139,"context_line":"        self.assertEquals(range.range_for_length(10)[0], (3, 10))"},{"line_number":140,"context_line":"        self.assertEquals(range.range_for_length(5), None)"},{"line_number":141,"context_line":"        self.assertEquals(range.range_for_length(None), None)"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJQY%3D","line":139,"updated":"2012-10-11 17:02:43.000000000","message":"In all these tests where you\u0027re testing the contents of the list returned by range_for_length(), can you change the assertion to test the entire list?\n\nFor example, here, there\u0027s no proof that there\u0027s not some value at [1] waiting to foul things up.  Something like this:\n\n self.assertEquals(range.range_for_length(10), [(3, 10)])","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"d163321caf714ac31cb86e8267a41793a74b6882","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    def test_range_for_length_no_start(self):"},{"line_number":138,"context_line":"        range \u003d swift.common.swob.Range(\u0027bytes\u003d-7\u0027)"},{"line_number":139,"context_line":"        self.assertEquals(range.range_for_length(10)[0], (3, 10))"},{"line_number":140,"context_line":"        self.assertEquals(range.range_for_length(5), None)"},{"line_number":141,"context_line":"        self.assertEquals(range.range_for_length(None), None)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_range_for_length_multi(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJQg%3D","line":140,"updated":"2012-10-11 17:02:43.000000000","message":"The old test for an input length of 5 was correct.  Don\u0027t change the test; keep it passing.","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"e712049ddc256582b58fb30d414ff25e98e11a1e","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    def test_range_for_length_no_start(self):"},{"line_number":138,"context_line":"        range \u003d swift.common.swob.Range(\u0027bytes\u003d-7\u0027)"},{"line_number":139,"context_line":"        self.assertEquals(range.range_for_length(10)[0], (3, 10))"},{"line_number":140,"context_line":"        self.assertEquals(range.range_for_length(5), None)"},{"line_number":141,"context_line":"        self.assertEquals(range.range_for_length(None), None)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_range_for_length_multi(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJLs%3D","line":140,"in_reply_to":"AAAALH%2F%2FJQg%3D","updated":"2012-10-11 18:25:22.000000000","message":"I am not sure if the behavior is correct. By looking at the spec, it seems it should be considered unsatisfiable. Unless I misread the spec. let me dig the spec a bit more and same time can you show where it says that in this case, it should return the entire content?","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"d163321caf714ac31cb86e8267a41793a74b6882","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        # the length of the ranges should be 4"},{"line_number":146,"context_line":"        self.assertEquals(len(range.range_for_length(200)), 4)"},{"line_number":147,"context_line":"        # the actual length less than any of the range"},{"line_number":148,"context_line":"        self.assertEquals(range.range_for_length(90)[0], (70, 90))"},{"line_number":149,"context_line":"        self.assertEquals(range.range_for_length(90)[1], (4, 90))"},{"line_number":150,"context_line":"        self.assertEquals(range.range_for_length(90)[2], (30, 90))"},{"line_number":151,"context_line":"        self.assertEquals(range.range_for_length(90)[3], (80, 90))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FJQM%3D","line":148,"updated":"2012-10-11 17:02:43.000000000","message":"As above, this could be one assertEquals which tests the list returned by range_for_length(), which is a tighter test proving there is no 5th element.","commit_id":"76d99e3999c20309499c4671b84c71699c64961a"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        for chunk in resp._multi_range_iter(app_iter(), args, \u0027text/plain\u0027):"},{"line_number":428,"context_line":"            content +\u003d chunk"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        self.assert_(\u00270123456789\u0027 in content)"},{"line_number":431,"context_line":"        self.assert_(\u00271123456789\u0027 in content)"},{"line_number":432,"context_line":"        self.assert_(\u00272123456789\u0027 in content)"},{"line_number":433,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI6c%3D","line":430,"updated":"2012-10-12 00:24:08.000000000","message":"These three strings in content should be in a particular order, right? Can you assert that as well?","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        for chunk in resp._multi_range_iter(app_iter(), args, \u0027text/plain\u0027):"},{"line_number":428,"context_line":"            content +\u003d chunk"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        self.assert_(\u00270123456789\u0027 in content)"},{"line_number":431,"context_line":"        self.assert_(\u00271123456789\u0027 in content)"},{"line_number":432,"context_line":"        self.assert_(\u00272123456789\u0027 in content)"},{"line_number":433,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI5Q%3D","line":430,"in_reply_to":"AAAALH%2F%2FI6c%3D","updated":"2012-10-12 00:59:34.000000000","message":"Yes, they should be.","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"9850710beeb6a66ce488c323cbb2862ea7335dbe","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        resp.conditional_response \u003d True"},{"line_number":428,"context_line":"        resp.content_length \u003d 100"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        content \u003d \u0027\u0027"},{"line_number":431,"context_line":"        for chunk in resp._response_iter(object(), \u0027\u0027):"},{"line_number":432,"context_line":"            content +\u003d chunk"},{"line_number":433,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7Rs%3D","line":430,"updated":"2012-10-26 18:23:44.000000000","message":"Can you change these (there\u0027s a few) to:\n\n content \u003d \u0027\u0027.join(resp._response_iter(...))","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ee7d0f4514f870a36f9449c8201add3e9dabad26","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        resp.conditional_response \u003d True"},{"line_number":428,"context_line":"        resp.content_length \u003d 100"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        content \u003d \u0027\u0027"},{"line_number":431,"context_line":"        for chunk in resp._response_iter(object(), \u0027\u0027):"},{"line_number":432,"context_line":"            content +\u003d chunk"},{"line_number":433,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7Oc%3D","line":430,"in_reply_to":"AAAALn%2F%2F7Rs%3D","updated":"2012-10-26 19:54:40.000000000","message":"Done","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"9850710beeb6a66ce488c323cbb2862ea7335dbe","unresolved":false,"context_lines":[{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        self.assertEquals(resp.status, \u0027416 Request Range Not Satisfiable\u0027)"},{"line_number":435,"context_line":"        self.assertEqual(0, resp.content_length)"},{"line_number":436,"context_line":"        self.assertEqual(0, len(content))"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def test_single_range_wo_iter_range(self):"},{"line_number":439,"context_line":"        def test_app(environ, start_response):"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7Rg%3D","line":436,"updated":"2012-10-26 18:23:44.000000000","message":"If you assert that content is \u0027\u0027 (the empty-string), you\u0027ll get a more helpful failure if this test ever starts failing (the test runner will see the incorrect value of content, not just its length).","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ee7d0f4514f870a36f9449c8201add3e9dabad26","unresolved":false,"context_lines":[{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        self.assertEquals(resp.status, \u0027416 Request Range Not Satisfiable\u0027)"},{"line_number":435,"context_line":"        self.assertEqual(0, resp.content_length)"},{"line_number":436,"context_line":"        self.assertEqual(0, len(content))"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def test_single_range_wo_iter_range(self):"},{"line_number":439,"context_line":"        def test_app(environ, start_response):"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7OQ%3D","line":436,"in_reply_to":"AAAALn%2F%2F7Rg%3D","updated":"2012-10-26 19:54:40.000000000","message":"Done","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"9850710beeb6a66ce488c323cbb2862ea7335dbe","unresolved":false,"context_lines":[{"line_number":467,"context_line":"        resp.conditional_response \u003d True"},{"line_number":468,"context_line":"        resp.content_length \u003d 100"},{"line_number":469,"context_line":""},{"line_number":470,"context_line":"        #test the plain text content"},{"line_number":471,"context_line":"        resp.content_type \u003d \u0027text/plain\u0027"},{"line_number":472,"context_line":"        args \u003d req.range.ranges_for_length(100)"},{"line_number":473,"context_line":"        content \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7RY%3D","line":470,"updated":"2012-10-26 18:23:44.000000000","message":"I think I had an earlier review comment w/some suggestions for these two tests (test_multi_range_body and test_multi_response_iter).","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ee7d0f4514f870a36f9449c8201add3e9dabad26","unresolved":false,"context_lines":[{"line_number":467,"context_line":"        resp.conditional_response \u003d True"},{"line_number":468,"context_line":"        resp.content_length \u003d 100"},{"line_number":469,"context_line":""},{"line_number":470,"context_line":"        #test the plain text content"},{"line_number":471,"context_line":"        resp.content_type \u003d \u0027text/plain\u0027"},{"line_number":472,"context_line":"        args \u003d req.range.ranges_for_length(100)"},{"line_number":473,"context_line":"        content \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7OI%3D","line":470,"in_reply_to":"AAAALn%2F%2F7RY%3D","updated":"2012-10-26 19:54:40.000000000","message":"Done","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"39d23ffb63a3c764eafaede5192e149f56c1d65e","unresolved":false,"context_lines":[{"line_number":464,"context_line":"        resp.content_length \u003d 100"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        resp.content_type \u003d \u0027text/plain\u0027"},{"line_number":467,"context_line":"        content \u003d \u0027\u0027"},{"line_number":468,"context_line":"        for chunk in resp._response_iter(None,"},{"line_number":469,"context_line":"                                         \u0027012345678911234567892123456789\u0027):"},{"line_number":470,"context_line":"            content +\u003d chunk"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F69w%3D","line":467,"updated":"2012-10-26 23:04:02.000000000","message":"This could use the same\n\n \u0027\u0027.join(...)\n\ntrick","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"aca151664527159b231d3a7a5276678299110add","unresolved":false,"context_lines":[{"line_number":464,"context_line":"        resp.content_length \u003d 100"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        resp.content_type \u003d \u0027text/plain\u0027"},{"line_number":467,"context_line":"        content \u003d \u0027\u0027"},{"line_number":468,"context_line":"        for chunk in resp._response_iter(None,"},{"line_number":469,"context_line":"                                         \u0027012345678911234567892123456789\u0027):"},{"line_number":470,"context_line":"            content +\u003d chunk"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F68s%3D","line":467,"in_reply_to":"AAAALn%2F%2F69w%3D","updated":"2012-10-26 23:23:45.000000000","message":"Done","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        content \u003d \u0027\u0027.join(resp._response_iter(object(), \u0027\u0027))"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertEquals(resp.status, \u0027416 Request Range Not Satisfiable\u0027)"},{"line_number":442,"context_line":"        self.assertEqual(0, resp.content_length)"},{"line_number":443,"context_line":"        self.assertEqual(\u0027\u0027, content)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5aQ%3D","line":441,"updated":"2012-10-30 01:16:56.000000000","message":"You\u0027re probably going to get a test failure on this one now. Commit 9cb7751 changed this to be \"416 Request*ed* Range Not Satisfiable\", as that\u0027s what RFC2616 has in it.\n\nSorry about that. At least it\u0027s a trivial fix.\n\nThere\u0027s a couple more of those in this file, too.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        content \u003d \u0027\u0027.join(resp._response_iter(object(), \u0027\u0027))"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertEquals(resp.status, \u0027416 Request Range Not Satisfiable\u0027)"},{"line_number":442,"context_line":"        self.assertEqual(0, resp.content_length)"},{"line_number":443,"context_line":"        self.assertEqual(\u0027\u0027, content)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5Ho%3D","line":441,"in_reply_to":"AAAALn%2F%2F5aQ%3D","updated":"2012-10-30 13:40:24.000000000","message":"all these test cases will be verified and behavior will be changed to\nmatch what have been discussed.","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"}],"test/unit/obj/test_server.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"1e952efa63914e6753fd722b9c090ce7a28db0f3","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            sio.write(chunk)"},{"line_number":137,"context_line":"        value \u003d sio.getvalue()"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        self.assert_(base64.encodestring(\u00273456789\u0027) in value)"},{"line_number":140,"context_line":"        self.assert_(base64.encodestring(\u002701\u0027) in value)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI68%3D","line":139,"updated":"2012-10-12 00:24:08.000000000","message":"Shouldn\u0027t this assert that the 3-10 range comes before the 0-2 range?  It looks like it\u0027s currently just testing that each appears somewhere.\n\nI think value would just be equal to\n\n base64.encodestring(\u00273456789\u0027) + base64.encodestring(\u002701\u0027)\n\nright?","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"4d57e70247ab459cd7db5d4dd222030d6bbf87d2","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            sio.write(chunk)"},{"line_number":137,"context_line":"        value \u003d sio.getvalue()"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        self.assert_(base64.encodestring(\u00273456789\u0027) in value)"},{"line_number":140,"context_line":"        self.assert_(base64.encodestring(\u002701\u0027) in value)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI1c%3D","line":139,"in_reply_to":"AAAALH%2F%2FI5I%3D","updated":"2012-10-12 08:39:14.000000000","message":"Ah, okay, maybe a regex that proves one comes before the other without specifying what\u0027s before, in between, or after?","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"817f45f1783a7dc93971cdd074368ee06d6be8f8","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            sio.write(chunk)"},{"line_number":137,"context_line":"        value \u003d sio.getvalue()"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        self.assert_(base64.encodestring(\u00273456789\u0027) in value)"},{"line_number":140,"context_line":"        self.assert_(base64.encodestring(\u002701\u0027) in value)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FI5I%3D","line":139,"in_reply_to":"AAAALH%2F%2FI68%3D","updated":"2012-10-12 00:59:34.000000000","message":"no, they are base64 encoded and separated by section header","commit_id":"85458611465a0dd9e543a2d37153735042362c95"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"9850710beeb6a66ce488c323cbb2862ea7335dbe","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        setxattr(f.fileno(), object_server.METADATA_KEY,"},{"line_number":93,"context_line":"                 pickle.dumps({}, object_server.PICKLE_PROTOCOL))"},{"line_number":94,"context_line":"        f.close()"},{"line_number":95,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"},{"line_number":96,"context_line":"                                    FakeLogger(), keep_data_fp\u003dTrue)"},{"line_number":97,"context_line":"        it \u003d df.app_iter_ranges([(0, 10), (10, 20), (20, 30)], \u0027plain/text\u0027,"},{"line_number":98,"context_line":"                                \u0027\\r\\n--someheader\\r\\n\u0027, 30)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7RI%3D","line":95,"updated":"2012-10-26 18:23:44.000000000","message":"Everything up to here could be refactored into a helper method which takes the value given to \"f.write()\" as input and returns the object_server.DiskFile object with keep_data_fp\u003dTrue set.","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"ee7d0f4514f870a36f9449c8201add3e9dabad26","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        setxattr(f.fileno(), object_server.METADATA_KEY,"},{"line_number":93,"context_line":"                 pickle.dumps({}, object_server.PICKLE_PROTOCOL))"},{"line_number":94,"context_line":"        f.close()"},{"line_number":95,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"},{"line_number":96,"context_line":"                                    FakeLogger(), keep_data_fp\u003dTrue)"},{"line_number":97,"context_line":"        it \u003d df.app_iter_ranges([(0, 10), (10, 20), (20, 30)], \u0027plain/text\u0027,"},{"line_number":98,"context_line":"                                \u0027\\r\\n--someheader\\r\\n\u0027, 30)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2F7Kw%3D","line":95,"in_reply_to":"AAAALn%2F%2F7RI%3D","updated":"2012-10-26 19:54:40.000000000","message":"Done","commit_id":"f52f88dfb6e4c890ea5cb2253329d1756c5fcb91"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"39d23ffb63a3c764eafaede5192e149f56c1d65e","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def test_disk_file_app_iter_corners(self):"},{"line_number":74,"context_line":"        df \u003d self._create_test_file(\u00271234567890\u0027)"},{"line_number":75,"context_line":"        it \u003d df.app_iter_range(0, None)"},{"line_number":76,"context_line":"        sio \u003d StringIO()"},{"line_number":77,"context_line":"        for chunk in it:"},{"line_number":78,"context_line":"            sio.write(chunk)"},{"line_number":79,"context_line":"        self.assertEquals(sio.getvalue(), \u00271234567890\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F69M%3D","line":76,"updated":"2012-10-26 23:04:02.000000000","message":"This could be something like\n\n value \u003d \u0027\u0027.join(df.app_iter_range(0, None))\n\n(No need for StringIO).  You could even inline that into the self.assertEquals() call.","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"aca151664527159b231d3a7a5276678299110add","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def test_disk_file_app_iter_corners(self):"},{"line_number":74,"context_line":"        df \u003d self._create_test_file(\u00271234567890\u0027)"},{"line_number":75,"context_line":"        it \u003d df.app_iter_range(0, None)"},{"line_number":76,"context_line":"        sio \u003d StringIO()"},{"line_number":77,"context_line":"        for chunk in it:"},{"line_number":78,"context_line":"            sio.write(chunk)"},{"line_number":79,"context_line":"        self.assertEquals(sio.getvalue(), \u00271234567890\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F67o%3D","line":76,"in_reply_to":"AAAALn%2F%2F69M%3D","updated":"2012-10-26 23:23:45.000000000","message":"Done","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"39d23ffb63a3c764eafaede5192e149f56c1d65e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        sio \u003d StringIO()"},{"line_number":85,"context_line":"        for chunk in it:"},{"line_number":86,"context_line":"            sio.write(chunk)"},{"line_number":87,"context_line":"        self.assertEquals(sio.getvalue(), \u002767890\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_disk_file_app_iter_ranges(self):"},{"line_number":90,"context_line":"        df \u003d self._create_test_file(\u0027012345678911234567892123456789\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F69I%3D","line":87,"updated":"2012-10-26 23:04:02.000000000","message":"Here you could just use\n\n self.assertEquals(\u0027\u0027.join(it), \u002767890\u0027)\n\n(And ditto a few more times below)","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"aca151664527159b231d3a7a5276678299110add","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        sio \u003d StringIO()"},{"line_number":85,"context_line":"        for chunk in it:"},{"line_number":86,"context_line":"            sio.write(chunk)"},{"line_number":87,"context_line":"        self.assertEquals(sio.getvalue(), \u002767890\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_disk_file_app_iter_ranges(self):"},{"line_number":90,"context_line":"        df \u003d self._create_test_file(\u0027012345678911234567892123456789\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F67s%3D","line":87,"in_reply_to":"AAAALn%2F%2F69I%3D","updated":"2012-10-26 23:23:45.000000000","message":"Done","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"39d23ffb63a3c764eafaede5192e149f56c1d65e","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        value \u003d \u0027\u0027"},{"line_number":149,"context_line":"        for chunk in it:"},{"line_number":150,"context_line":"            value +\u003d chunk"},{"line_number":151,"context_line":"        self.assertEqual(value, \u0027\u0027)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"},{"line_number":154,"context_line":"                                    FakeLogger(), keep_data_fp\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F69A%3D","line":151,"updated":"2012-10-26 23:04:02.000000000","message":"Could be\n\n self.assertEqual(\u0027\u0027.join(it), \u0027\u0027)","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"aca151664527159b231d3a7a5276678299110add","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        value \u003d \u0027\u0027"},{"line_number":149,"context_line":"        for chunk in it:"},{"line_number":150,"context_line":"            value +\u003d chunk"},{"line_number":151,"context_line":"        self.assertEqual(value, \u0027\u0027)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        df \u003d object_server.DiskFile(self.testdir, \u0027sda1\u0027, \u00270\u0027, \u0027a\u0027, \u0027c\u0027, \u0027o\u0027,"},{"line_number":154,"context_line":"                                    FakeLogger(), keep_data_fp\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAALn%2F%2F67k%3D","line":151,"in_reply_to":"AAAALn%2F%2F69A%3D","updated":"2012-10-26 23:23:45.000000000","message":"Done","commit_id":"f814667ae6d0e81a90e20535254771af7aacd42d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"14779846231da6ee5010646c6fd22eeaa7ac0d31","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                                \u00275e816ff8b8b8e9a5d355497e5d9e0301\u0027, 655360)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        # the produced string actually missing the MIME headers"},{"line_number":111,"context_line":"        # need to add these headesr to make it as real MIME message"},{"line_number":112,"context_line":"        # though added header, the body of the message is produced by"},{"line_number":113,"context_line":"        # method app_iter_ranges off of DiskFile object."},{"line_number":114,"context_line":"        header \u003d \u0027\u0027.join([\u0027Content-Type: multipart/byteranges;\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5aM%3D","line":111,"updated":"2012-10-30 01:16:56.000000000","message":"*headers","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"f3e30f9133b1095391db9147d2edca47521742f2","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                                \u00275e816ff8b8b8e9a5d355497e5d9e0301\u0027, 655360)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        # the produced string actually missing the MIME headers"},{"line_number":111,"context_line":"        # need to add these headesr to make it as real MIME message"},{"line_number":112,"context_line":"        # though added header, the body of the message is produced by"},{"line_number":113,"context_line":"        # method app_iter_ranges off of DiskFile object."},{"line_number":114,"context_line":"        header \u003d \u0027\u0027.join([\u0027Content-Type: multipart/byteranges;\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAALn%2F%2F5HU%3D","line":111,"in_reply_to":"AAAALn%2F%2F5aM%3D","updated":"2012-10-30 13:40:24.000000000","message":"Done","commit_id":"5825cf1e00ddc48c6b33e7f91a3240442eb578d3"}]}
