Rev 3809: Handle when _open_bzr_log returns None. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration
John Arbash Meinel
john at arbash-meinel.com
Sat Nov 1 14:45:10 GMT 2008
At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------
revno: 3809
revision-id: john at arbash-meinel.com-20081101144447-vbmq05112a8lewcn
parent: john at arbash-meinel.com-20081030141826-6267bwt9p372nrsi
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Sat 2008-11-01 09:44:47 -0500
message:
Handle when _open_bzr_log returns None.
-------------- next part --------------
=== modified file 'bzrlib/trace.py'
--- a/bzrlib/trace.py 2008-10-30 14:18:26 +0000
+++ b/bzrlib/trace.py 2008-11-01 14:44:47 +0000
@@ -230,6 +230,7 @@
# TODO: What should happen if we fail to open the trace file? Maybe the
# objects should be pointed at /dev/null or the equivalent? Currently
# returns None which will cause failures later.
+ return None
def enable_default_logging():
@@ -250,7 +251,8 @@
timezone='local')
# create encoded wrapper around stderr
bzr_log_file = _open_bzr_log()
- bzr_log_file.write(start_time.encode('utf-8') + '\n')
+ if bzr_log_file is not None:
+ bzr_log_file.write(start_time.encode('utf-8') + '\n')
push_log_file(bzr_log_file,
r'[%(process)5d] %(asctime)s.%(msecs)03d %(levelname)s: %(message)s',
r'%Y-%m-%d %H:%M:%S')
More information about the bazaar-commits
mailing list