warnings during blackbox test cleanup cause flush errors

Bug #609920 reported by Jelmer Vernooij
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

  affects bzr
  status confirmed
  importance medium

If the test directory gets removed as part of the test the test runner
will attempt to print a warning. This fails:

------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/testtools/testcase.py", line
153, in _runCleanups
    function(*arguments, **keywordArguments)
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/tests/__init__.py", line
1471, in _finishLogFile
    bzrlib.trace.pop_log_file(self._log_memento)
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/trace.py", line 384, in
pop_log_file
    new_trace_file.flush()
ValueError: I/O operation on closed file
------------

The following patch makes the error go away and gets me a proper
warning:

--- bzrlib/trace.py 2010-06-28 02:41:22 +0000
+++ bzrlib/trace.py 2010-07-26 00:59:43 +0000
@@ -380,8 +380,6 @@
     # file will likely already be closed underneath.
     new_handler.close()
     bzr_logger.handlers = old_handlers
- if new_trace_file is not None:
- new_trace_file.flush()

Jelmer Vernooij (jelmer)
tags: added: selftest
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.