)]}'
{"nova/utils.py":[{"author":{"_account_id":5280,"name":"Nicolas Simonds","email":"nic@metacloud.com","username":"nicolas.simonds"},"change_message_id":"7c125e1fd5291c68d8b3519c35fd56d74881219a","unresolved":false,"context_lines":[{"line_number":1264,"context_line":"class PrivilegedFileReader(io.RawIOBase):"},{"line_number":1265,"context_line":"    \"\"\"A file like object which reads files with escalated permissions.\"\"\""},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"    # NOTE(mikal): this will only work with block devices. You\u0027re welcome."},{"line_number":1268,"context_line":"    # This proxy exists because privsep is stateless by design, so we hold the"},{"line_number":1269,"context_line":"    # state on our side of the boundary and simulate state on the escalated"},{"line_number":1270,"context_line":"    # side."},{"line_number":1271,"context_line":""},{"line_number":1272,"context_line":"    def __init__(self, path):"},{"line_number":1273,"context_line":"        self.path \u003d path"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f2577a7_90b04d8c","line":1270,"range":{"start_line":1267,"start_character":0,"end_line":1270,"end_character":11},"updated":"2017-09-14 20:27:10.000000000","message":"The failure modes on this for anything other than whole-file (for otherwise atomic) reads will be subtle and confusing; it should be expressly mentioned so that people have it in mind when reading code that makes use of this.","commit_id":"c914be139d979179a553b5375b85ef776df5fb9e"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"0d85541d977d1edce098363b5c06f781d6abe51b","unresolved":false,"context_lines":[{"line_number":1264,"context_line":"class PrivilegedFileReader(io.RawIOBase):"},{"line_number":1265,"context_line":"    \"\"\"A file like object which reads files with escalated permissions.\"\"\""},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"    # NOTE(mikal): this will only work with block devices. You\u0027re welcome."},{"line_number":1268,"context_line":"    # This proxy exists because privsep is stateless by design, so we hold the"},{"line_number":1269,"context_line":"    # state on our side of the boundary and simulate state on the escalated"},{"line_number":1270,"context_line":"    # side."},{"line_number":1271,"context_line":""},{"line_number":1272,"context_line":"    def __init__(self, path):"},{"line_number":1273,"context_line":"        self.path \u003d path"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f2577a7_abb3d897","line":1270,"range":{"start_line":1267,"start_character":0,"end_line":1270,"end_character":11},"in_reply_to":"5f2577a7_90b04d8c","updated":"2017-09-14 20:56:55.000000000","message":"Well, this assumes that the file is quiesced while the read occurs, which is a thing we already assume in the case I\u0027m thinking of for this. I\u0027d be fine with calling that out more clearly in a comment here if you want.","commit_id":"c914be139d979179a553b5375b85ef776df5fb9e"},{"author":{"_account_id":5280,"name":"Nicolas Simonds","email":"nic@metacloud.com","username":"nicolas.simonds"},"change_message_id":"0d539f7ed2a831b27f26c82e750edd575709acac","unresolved":false,"context_lines":[{"line_number":1264,"context_line":"class PrivilegedFileReader(io.RawIOBase):"},{"line_number":1265,"context_line":"    \"\"\"A file like object which reads files with escalated permissions.\"\"\""},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"    # NOTE(mikal): this will only work with block devices. You\u0027re welcome."},{"line_number":1268,"context_line":"    # This proxy exists because privsep is stateless by design, so we hold the"},{"line_number":1269,"context_line":"    # state on our side of the boundary and simulate state on the escalated"},{"line_number":1270,"context_line":"    # side."},{"line_number":1271,"context_line":""},{"line_number":1272,"context_line":"    def __init__(self, path):"},{"line_number":1273,"context_line":"        self.path \u003d path"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f2577a7_f1ce72b2","line":1270,"range":{"start_line":1267,"start_character":0,"end_line":1270,"end_character":11},"in_reply_to":"5f2577a7_abb3d897","updated":"2017-09-14 22:06:32.000000000","message":"Yes.  This looks perfectly serviceable for the use case you\u0027re writing it against, but for things like temp files according to best practice (open the fd and then unlink the file) and similar, this will behave in a counterintuitive fashion.  Ensuring those expectations are properly set can only be a good thing.","commit_id":"c914be139d979179a553b5375b85ef776df5fb9e"}]}
