)]}'
{"swift/common/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"758e3043c833ce026c5eac2952c33024743b768c","unresolved":false,"context_lines":[{"line_number":1285,"context_line":"                              {\u0027type\u0027: self.log_type,"},{"line_number":1286,"context_line":"                               \u0027value\u0027: \u0027#012\u0027.join(values)})"},{"line_number":1287,"context_line":"        finally:"},{"line_number":1288,"context_line":"            self._cls_thread_local.already_called_writelines \u003d False"},{"line_number":1289,"context_line":""},{"line_number":1290,"context_line":"    def close(self):"},{"line_number":1291,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a061dce_d82745b4","line":1288,"updated":"2016-04-06 19:45:51.000000000","message":"when I see this sort of duplication I can\u0027t help but think decorator\n\nhttps://gist.github.com/clayg/a7725d86b9fd41f1863ae5010488b06d","commit_id":"81fe9ecd27decfc1261e9252e224f3a4e191c995"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"758e3043c833ce026c5eac2952c33024743b768c","unresolved":false,"context_lines":[{"line_number":1271,"context_line":"                try:"},{"line_number":1272,"context_line":"                    # Pretend to be trying to send to syslog, but syslogd is"},{"line_number":1273,"context_line":"                    # dead. We need the raise here to set sys.exc_info."},{"line_number":1274,"context_line":"                    raise socket.error(errno.ENOTCONN, \"This is an ex-syslog\")"},{"line_number":1275,"context_line":"                except socket.error:"},{"line_number":1276,"context_line":"                    self.handleError(record)"},{"line_number":1277,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a061dce_32af822b","line":1274,"updated":"2016-04-06 19:45:51.000000000","message":"maybe set a closed over boolean somewhere in here and assert it after calling the logger?\n\n    diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py\n    index 61011a5..83fb3f5 100644\n    --- a/test/unit/common/test_utils.py\n    +++ b/test/unit/common/test_utils.py\n    @@ -1265,9 +1265,11 @@ class TestUtils(unittest.TestCase):\n                 lfo.tell()\n     \n         def test_LoggerFileObject_recursion(self):\n    +        called \u003d []\n     \n             class CrashyLogger(logging.Handler):\n                 def emit(self, record):\n    +                called.append(True)\n                     try:\n                         # Pretend to be trying to send to syslog, but syslogd is\n                         # dead. We need the raise here to set sys.exc_info.\n    @@ -1285,6 +1287,7 @@ class TestUtils(unittest.TestCase):\n                     mock.patch(\u0027logging.raiseExceptions\u0027, True):\n                 utils.capture_stdio(logger)\n                 logger.info(\"I like ham\")\n    +        self.assertEqual(called, [True])\n     \n         def test_parse_options(self):\n             # Get a file that is definitely on disk","commit_id":"81fe9ecd27decfc1261e9252e224f3a4e191c995"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"758e3043c833ce026c5eac2952c33024743b768c","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"        # logging.raiseExceptions is set to False in test/__init__.py, but"},{"line_number":1282,"context_line":"        # is True in Swift daemons, and the error doesn\u0027t manifest without"},{"line_number":1283,"context_line":"        # it."},{"line_number":1284,"context_line":"        with mock.patch.object(utils, \u0027sys\u0027, MockSys()), \\"},{"line_number":1285,"context_line":"                mock.patch(\u0027logging.raiseExceptions\u0027, True):"},{"line_number":1286,"context_line":"            utils.capture_stdio(logger)"},{"line_number":1287,"context_line":"            logger.info(\"I like ham\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a061dce_1d424f68","line":1284,"updated":"2016-04-06 19:45:51.000000000","message":"since this mock prevents capture_stdio from mutating the real sys module - inside of handleError we have a real sys.stderr\n\nhttps://gist.github.com/clayg/024ebf4b05c77ba6471283fc60f0e0c1","commit_id":"81fe9ecd27decfc1261e9252e224f3a4e191c995"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d20373515200122b20aa3e68f9bcf12f520860a6","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"        # it."},{"line_number":1284,"context_line":"        with mock.patch.object(utils, \u0027sys\u0027, MockSys()), \\"},{"line_number":1285,"context_line":"                mock.patch(\u0027logging.raiseExceptions\u0027, True):"},{"line_number":1286,"context_line":"            utils.capture_stdio(logger)"},{"line_number":1287,"context_line":"            logger.info(\"I like ham\")"},{"line_number":1288,"context_line":""},{"line_number":1289,"context_line":"    def test_parse_options(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a061dce_7de26b30","line":1286,"range":{"start_line":1286,"start_character":18,"end_line":1286,"end_character":31},"updated":"2016-04-06 19:29:46.000000000","message":"Tests still pass when I revert swift/, whether I run them through tox, .unittests, or nosetests. When I run them, I see\n\n Traceback (most recent call last):\n   File \"/vagrant/swift/test/unit/common/test_utils.py\", line 1274, in emit\n     raise socket.error(errno.ENOTCONN, \"This is an ex-syslog\")\n error: [Errno 107] This is an ex-syslog\n Logged from file test_utils.py, line 1287\n\non stderr. I think the test runner is already capturing stderr, so capture_stdio doesn\u0027t do what we expect :(","commit_id":"81fe9ecd27decfc1261e9252e224f3a4e191c995"}]}
