)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"10447aefe13ba9ca5dc7cbd74684a076ba9004c8","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Cuong Nguyen \u003ccuongnv@vn.fujitsu.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-01-20 16:13:16 +0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use context manager for better file handling"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Iee5a4f47b4b7143316fedd61378c6697f7ef3187"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a3905b3_f6eedfb2","line":7,"updated":"2017-01-20 22:38:03.000000000","message":"Can you add more detail as to why this is better (expand your commit message a bit with justification)?","commit_id":"51d775e1949ed02e1b9ba461b3de729e3beb2d3d"},{"author":{"_account_id":24441,"name":"Cuong Nguyen","email":"cuongnv@vn.fujitsu.com","username":"cuongnv"},"change_message_id":"36412b44b1a44c8294ebc850040138ecff43ec76","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Cuong Nguyen \u003ccuongnv@vn.fujitsu.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-01-20 16:13:16 +0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use context manager for better file handling"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Iee5a4f47b4b7143316fedd61378c6697f7ef3187"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a3905b3_0dfc16b7","line":7,"in_reply_to":"5a3905b3_f6eedfb2","updated":"2017-01-23 08:44:25.000000000","message":"Sure, thanks for your review.\np/s: forgot to push above reply :)","commit_id":"51d775e1949ed02e1b9ba461b3de729e3beb2d3d"}],"ironic/tests/unit/common/test_pxe_utils.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7ba2af4fbd403828454cbbe3def1a22aa1a9fb41","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             \u0027DISK_IDENTIFIER\u0027: \u0027{{ DISK_IDENTIFIER }}\u0027})"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        expected_template \u003d open("},{"line_number":78,"context_line":"            \u0027ironic/tests/unit/drivers/pxe_config.template\u0027).read().rstrip()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        self.assertEqual(six.text_type(expected_template), rendered_template)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_92b1f049","side":"PARENT","line":78,"updated":"2017-01-23 12:27:46.000000000","message":"It\u0027s considered a poor practice to wait until __del__ for files to be closed. It may be ok in tests, but should never slip into production code. The reason is that __del__ 1. is not guaranteed to be called at any pretictable moment of time, 2. cannot report failures.","commit_id":"078fb81c13f3e5954e1efe430bdbc14474a83af5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"ae58c516b577e8bb11e5de78266e598c499a0cff","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             \u0027DISK_IDENTIFIER\u0027: \u0027{{ DISK_IDENTIFIER }}\u0027})"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        expected_template \u003d open("},{"line_number":78,"context_line":"            \u0027ironic/tests/unit/drivers/pxe_config.template\u0027).read().rstrip()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        self.assertEqual(six.text_type(expected_template), rendered_template)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_4f7b6028","side":"PARENT","line":78,"updated":"2017-01-23 11:54:31.000000000","message":"This is correct code for CPython at least. Temporary file object will be destroyed immediately and file closed by __del__() method. I add Mario\u0027s comment again: \"Can you add more detail as to why this is better\".","commit_id":"078fb81c13f3e5954e1efe430bdbc14474a83af5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6f21318dabe7f41f947b1e231fa406a54732fd71","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             \u0027DISK_IDENTIFIER\u0027: \u0027{{ DISK_IDENTIFIER }}\u0027})"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        expected_template \u003d open("},{"line_number":78,"context_line":"            \u0027ironic/tests/unit/drivers/pxe_config.template\u0027).read().rstrip()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        self.assertEqual(six.text_type(expected_template), rendered_template)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_5524d25e","side":"PARENT","line":78,"in_reply_to":"5a3905b3_1206e085","updated":"2017-01-23 12:58:52.000000000","message":"\u003e In CPython __del__() will be executed immediately here.\n\nDo you have a reference that? I\u0027ve faced with quite different __del__ behaviour even in CPython","commit_id":"078fb81c13f3e5954e1efe430bdbc14474a83af5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"aee175009b9b070affaea82e73839e915801e558","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             \u0027DISK_IDENTIFIER\u0027: \u0027{{ DISK_IDENTIFIER }}\u0027})"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        expected_template \u003d open("},{"line_number":78,"context_line":"            \u0027ironic/tests/unit/drivers/pxe_config.template\u0027).read().rstrip()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        self.assertEqual(six.text_type(expected_template), rendered_template)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_e3a50447","side":"PARENT","line":78,"in_reply_to":"5a3905b3_5524d25e","updated":"2017-01-23 13:37:53.000000000","message":"http://stackoverflow.com/questions/9046606/are-temporary-references-automatically-cleared-in-python","commit_id":"078fb81c13f3e5954e1efe430bdbc14474a83af5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"4432916eba818f285596e971ba8804b7b6c81ef9","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             \u0027DISK_IDENTIFIER\u0027: \u0027{{ DISK_IDENTIFIER }}\u0027})"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        expected_template \u003d open("},{"line_number":78,"context_line":"            \u0027ironic/tests/unit/drivers/pxe_config.template\u0027).read().rstrip()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        self.assertEqual(six.text_type(expected_template), rendered_template)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_1206e085","side":"PARENT","line":78,"in_reply_to":"5a3905b3_92b1f049","updated":"2017-01-23 12:36:53.000000000","message":"In CPython  __del__() will be executed immediately here. \"...is not guaranteed to be called at any pretictable moment of time...\" this is implementation specific. But context manager is good if we want more \"generic\" code.","commit_id":"078fb81c13f3e5954e1efe430bdbc14474a83af5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"dc84c358fdaca169822c97ce1bc0633509c20396","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             \u0027DISK_IDENTIFIER\u0027: \u0027{{ DISK_IDENTIFIER }}\u0027})"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        expected_template \u003d open("},{"line_number":78,"context_line":"            \u0027ironic/tests/unit/drivers/pxe_config.template\u0027).read().rstrip()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        self.assertEqual(six.text_type(expected_template), rendered_template)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_c9566729","side":"PARENT","line":78,"in_reply_to":"5a3905b3_e3a50447","updated":"2017-01-23 14:00:10.000000000","message":"yeah, so it happens to work in CPython (but not in the interactive interpreter btw). I\u0027d still prefer an explicit close.","commit_id":"078fb81c13f3e5954e1efe430bdbc14474a83af5"}]}
