)]}'
{"zuul_registry/filesystem.py":[{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"28970be4faf7842981a59b202b29584bf1a3e298","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        if not os.path.exists(path):"},{"line_number":66,"context_line":"            return None, None"},{"line_number":67,"context_line":"        f \u003d open(path, \u0027rb\u0027, buffering\u003dDISK_CHUNK_SIZE)"},{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            size \u003d f.seek(0, os.SEEK_END)"},{"line_number":70,"context_line":"            f.seek(0)"},{"line_number":71,"context_line":"        except OSError:"},{"line_number":72,"context_line":"            f.close()"},{"line_number":73,"context_line":"            raise"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        def data_iter(f\u003df):"},{"line_number":76,"context_line":"            with f:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_8762b6ac","line":73,"range":{"start_line":68,"start_character":8,"end_line":73,"end_character":17},"updated":"2019-10-07 09:53:15.000000000","message":"If those are normal files why not use `os.stat(path).st_size` as above in `get_object_size`? Am I missing something?\n\nAlso found this: https://wiki.sei.cmu.edu/confluence/display/c/FIO19-C.+Do+not+use+fseek%28%29+and+ftell%28%29+to+compute+the+size+of+a+regular+file which may be relevant here?","commit_id":"ba13b28e9e63a0ad9389f6f2573d4dbccd25d321"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"243b42b47d55c45e252fa2e6e6cbf2008924730e","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        if not os.path.exists(path):"},{"line_number":66,"context_line":"            return None, None"},{"line_number":67,"context_line":"        f \u003d open(path, \u0027rb\u0027, buffering\u003dDISK_CHUNK_SIZE)"},{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            size \u003d f.seek(0, os.SEEK_END)"},{"line_number":70,"context_line":"            f.seek(0)"},{"line_number":71,"context_line":"        except OSError:"},{"line_number":72,"context_line":"            f.close()"},{"line_number":73,"context_line":"            raise"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        def data_iter(f\u003df):"},{"line_number":76,"context_line":"            with f:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_f9f8e67c","line":73,"range":{"start_line":68,"start_character":8,"end_line":73,"end_character":17},"in_reply_to":"3fa7e38b_8762b6ac","updated":"2019-10-07 19:00:19.000000000","message":"I\u0027d worry about the file moving or getting deleted between calls. We can grab the fileno and stat *that* though... With an added benefit of fewer syscalls.\n\nGood find on seek/tell behavior -- I was mainly cribbing from behavior I\u0027ve seen boto3 exhibit [1]. Someone should tell them ;-)\n\n[1] https://github.com/boto/s3transfer/blob/4b03eef2a/s3transfer/upload.py#L318-L328","commit_id":"ba13b28e9e63a0ad9389f6f2573d4dbccd25d321"}],"zuul_registry/storageutils.py":[{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"e326bad330a85775d8a1921e59d1c6a85c3ed55d","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        :arg str path: The object path."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        :returns: The size and contents of the object."},{"line_number":103,"context_line":"        :rtype: tuple of (int or None, generator of bytearray)"},{"line_number":104,"context_line":"        \"\"\""},{"line_number":105,"context_line":"        pass"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_148347ab","line":103,"range":{"start_line":103,"start_character":39,"end_line":103,"end_character":48},"updated":"2019-10-07 19:10:14.000000000","message":"shouldn\u0027t this document generator or None too? In the main module, the second element of the tuple is checked for None.","commit_id":"db2ccc4e21b32db26369b4bd7fc593025dfcfd94"}]}
