)]}'
{"glean/cmd.py":[{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"4121f56b8a7ed43ba4fed9f7d53708b67406758b","unresolved":false,"context_lines":[{"line_number":1492,"context_line":"        for host in hosts_to_add:"},{"line_number":1493,"context_line":"            host_value \u003d hosts_to_add[host]"},{"line_number":1494,"context_line":"            # See if we already have a hosts entry for hostname"},{"line_number":1495,"context_line":"            with open(\u0027/etc/hosts\u0027, \u0027r+\u0027) as fh:"},{"line_number":1496,"context_line":"                for line in fh:"},{"line_number":1497,"context_line":"                    if line.startswith(\u0027%s %s\u0027 % (host_value, host)):"},{"line_number":1498,"context_line":"                        break"}],"source_content_type":"text/x-python","patch_set":1,"id":"96767336_e6e07602","line":1495,"updated":"2020-12-30 22:51:39.000000000","message":"Does this not need to restore the selinux context like we get via safe_open()?","commit_id":"124476b3554e7eccb432dc11a2a75b26285d3abb"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"4121f56b8a7ed43ba4fed9f7d53708b67406758b","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"                    if line.startswith(\u0027%s %s\u0027 % (host_value, host)):"},{"line_number":1498,"context_line":"                        break"},{"line_number":1499,"context_line":"                else:"},{"line_number":1500,"context_line":"                    print(u\u0027%s %s\u0027 % (host_value, host), file\u003dfh)"},{"line_number":1501,"context_line":""},{"line_number":1502,"context_line":"def main(argv\u003dNone):"},{"line_number":1503,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"d220b0b3_d766042b","line":1500,"updated":"2020-12-30 22:51:39.000000000","message":"Neat, I didn\u0027t consider appending via print().","commit_id":"124476b3554e7eccb432dc11a2a75b26285d3abb"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"0e62f5b9d7f3a63a1159e7f14337d66423228ed0","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import json"},{"line_number":23,"context_line":"import logging"},{"line_number":24,"context_line":"import os"},{"line_number":25,"context_line":"import re"},{"line_number":26,"context_line":"import subprocess"},{"line_number":27,"context_line":"import sys"},{"line_number":28,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":2,"id":"8437ad5a_c2c409e6","side":"PARENT","line":25,"updated":"2020-12-31 02:08:23.000000000","message":"pycodestyle says to remove the unused re import.","commit_id":"a507b711170c970c82db93565f23af8a3ce902e3"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"0e62f5b9d7f3a63a1159e7f14337d66423228ed0","unresolved":false,"context_lines":[{"line_number":1503,"context_line":"                with safe_open(\u0027/etc/hosts\u0027, \u0027a+\u0027) as fh:"},{"line_number":1504,"context_line":"                    fh.write(u\u0027%s %s\\n\u0027 % (host_value, host))"},{"line_number":1505,"context_line":""},{"line_number":1506,"context_line":""},{"line_number":1507,"context_line":"def main(argv\u003dNone):"},{"line_number":1508,"context_line":""},{"line_number":1509,"context_line":"    if argv is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"c24436b8_30e097bb","side":"PARENT","line":1506,"updated":"2020-12-31 02:08:23.000000000","message":"pycodestyle says you need an extra blank line before the main() definition.","commit_id":"a507b711170c970c82db93565f23af8a3ce902e3"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"0e62f5b9d7f3a63a1159e7f14337d66423228ed0","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"            host_value \u003d hosts_to_add[host]"},{"line_number":1494,"context_line":"            # See if we already have a hosts entry for hostname"},{"line_number":1495,"context_line":"            with safe_open(\u0027/etc/hosts\u0027, \u0027r+\u0027) as fh:"},{"line_number":1496,"context_line":"                for line in fh:"},{"line_number":1497,"context_line":"                    if line.startswith(\u0027%s %s\u0027 % (host_value, host)):"},{"line_number":1498,"context_line":"                        break"},{"line_number":1499,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"18abee33_8fabe2f4","line":1496,"updated":"2020-12-31 02:08:23.000000000","message":"This ends up being a Mock in unit tests and can\u0027t be iterated.","commit_id":"7efbe421a3d5289c1d3d98252997d404ac26d648"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"0e62f5b9d7f3a63a1159e7f14337d66423228ed0","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"                    if line.startswith(\u0027%s %s\u0027 % (host_value, host)):"},{"line_number":1498,"context_line":"                        break"},{"line_number":1499,"context_line":"                else:"},{"line_number":1500,"context_line":"                    print(u\u0027%s %s\u0027 % (host_value, host), file\u003dfh)"},{"line_number":1501,"context_line":""},{"line_number":1502,"context_line":"def main(argv\u003dNone):"},{"line_number":1503,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"2c239e22_87a29c2b","line":1500,"updated":"2020-12-31 02:08:23.000000000","message":"This won\u0027t work for Python 2.7.","commit_id":"7efbe421a3d5289c1d3d98252997d404ac26d648"},{"author":{"_account_id":14288,"name":"Matthew Thode","display_name":"prometheanfire","email":"mthode@mthode.org","username":"prometheanfire"},"change_message_id":"b18b89a6eeeeb9b39d159f203e4912f849a40159","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"                    if line.startswith(\u0027%s %s\u0027 % (host_value, host)):"},{"line_number":1498,"context_line":"                        break"},{"line_number":1499,"context_line":"                else:"},{"line_number":1500,"context_line":"                    print(u\u0027%s %s\u0027 % (host_value, host), file\u003dfh)"},{"line_number":1501,"context_line":""},{"line_number":1502,"context_line":"def main(argv\u003dNone):"},{"line_number":1503,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"2c0d867a_67779afe","line":1500,"updated":"2020-12-31 02:15:27.000000000","message":"do we still care about py27?  huh, guess so (in setup.cfg)","commit_id":"7efbe421a3d5289c1d3d98252997d404ac26d648"},{"author":{"_account_id":14288,"name":"Matthew Thode","display_name":"prometheanfire","email":"mthode@mthode.org","username":"prometheanfire"},"change_message_id":"11a7635414f69aa3a686de1bc2239c6edda24d34","unresolved":false,"context_lines":[{"line_number":1494,"context_line":"            # See if we already have a hosts entry for hostname"},{"line_number":1495,"context_line":"            prog \u003d re.compile(\u0027^%s .*%s\\n\u0027 % (host_value, host))"},{"line_number":1496,"context_line":"            match \u003d None"},{"line_number":1497,"context_line":"            if os.path.isfile(\u0027/etc/hosts\u0027):"},{"line_number":1498,"context_line":"                with open(\u0027/etc/hosts\u0027) as fh:"},{"line_number":1499,"context_line":"                    match \u003d prog.match(fh.read())"},{"line_number":1500,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"409ebdd1_8de06d03","side":"PARENT","line":1497,"updated":"2020-12-31 14:53:43.000000000","message":"it looks like I removed the \u0027isfile\u0027 check","commit_id":"a507b711170c970c82db93565f23af8a3ce902e3"},{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"414b93dcf4977d0252e3645544b515a5fe84d9ad","unresolved":false,"context_lines":[{"line_number":1501,"context_line":"            # Write out a hosts entry for hostname"},{"line_number":1502,"context_line":"            if match is None:"},{"line_number":1503,"context_line":"                with safe_open(\u0027/etc/hosts\u0027, \u0027a+\u0027) as fh:"},{"line_number":1504,"context_line":"                    fh.write(u\u0027%s %s\\n\u0027 % (host_value, host))"},{"line_number":1505,"context_line":""},{"line_number":1506,"context_line":""},{"line_number":1507,"context_line":"def main(argv\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"f84e9d53_9c4fbf69","side":"PARENT","line":1504,"updated":"2020-12-31 14:27:21.000000000","message":"Looks like write() should be safe with mode r+ in this case because the cursor will have ended up at the end of the file if the else clause is triggered.","commit_id":"a507b711170c970c82db93565f23af8a3ce902e3"},{"author":{"_account_id":14288,"name":"Matthew Thode","display_name":"prometheanfire","email":"mthode@mthode.org","username":"prometheanfire"},"change_message_id":"6014267225871c1fc3e942bb02a0d135c9d05447","unresolved":false,"context_lines":[{"line_number":1501,"context_line":"            # Write out a hosts entry for hostname"},{"line_number":1502,"context_line":"            if match is None:"},{"line_number":1503,"context_line":"                with safe_open(\u0027/etc/hosts\u0027, \u0027a+\u0027) as fh:"},{"line_number":1504,"context_line":"                    fh.write(u\u0027%s %s\\n\u0027 % (host_value, host))"},{"line_number":1505,"context_line":""},{"line_number":1506,"context_line":""},{"line_number":1507,"context_line":"def main(argv\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"c21b349d_7c30705e","side":"PARENT","line":1504,"updated":"2020-12-31 14:52:06.000000000","message":"yes, that\u0027s where new lines end up (in testing)","commit_id":"a507b711170c970c82db93565f23af8a3ce902e3"}],"glean/tests/test_glean.py":[{"author":{"_account_id":5263,"name":"Jeremy Stanley","display_name":"fungi","email":"fungi@yuggoth.org","username":"fungi","status":"missing, presumed fed"},"change_message_id":"414b93dcf4977d0252e3645544b515a5fe84d9ad","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                # note; don\u0027t use spec\u003dfile here ... it\u0027s not py3"},{"line_number":93,"context_line":"                # compatible.  It really just limits the allowed"},{"line_number":94,"context_line":"                # mocked functions."},{"line_number":95,"context_line":"                mock_handle \u003d mock.MagicMock()"},{"line_number":96,"context_line":"                mock_handle.__enter__ \u003d mock.Mock()"},{"line_number":97,"context_line":"                mock_handle.__exit__ \u003d mock.Mock()"},{"line_number":98,"context_line":"                mock_handle.name \u003d path"}],"source_content_type":"text/x-python","patch_set":4,"id":"dd1fd817_e75d7760","line":95,"updated":"2020-12-31 14:27:21.000000000","message":"No objection from me.","commit_id":"e47128ebe9d6428af7b6b56f2cb7973118053590"}]}
