/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/crash.py

  • Committer: Martin Pool
  • Date: 2010-02-02 16:31:56 UTC
  • mto: (4999.3.1 apport)
  • mto: This revision was merged to the branch mainline in revision 5002.
  • Revision ID: mbp@sourcefrog.net-20100202163156-7y1g0mae6j0ahnea
Update apport crash tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        # apport libraries but not have an apport always running, we could
126
126
        # synchronously file now
127
127
 
 
128
    return crash_filename
 
129
 
128
130
 
129
131
def _write_apport_report_to_file(exc_info):
130
132
    import traceback
183
185
        # eg configured off in ~/.apport-ignore.xml
184
186
        return None
185
187
    else:
186
 
        crash_file = _open_crash_file()
 
188
        crash_file_name, crash_file = _open_crash_file()
187
189
        pr.write(crash_file)
188
190
        crash_file.close()
189
 
        return crash_file.name
 
191
        return crash_file_name
190
192
 
191
193
 
192
194
def _attach_log_tail(pr):
193
195
    try:
194
196
        bzr_log = open(trace._get_bzr_log_filename(), 'rt')
 
197
    except (IOError, OSError), e:
 
198
        pr['BzrLogTail'] = repr(e)
 
199
        return
 
200
    try:
195
201
        lines = bzr_log.readlines()
196
202
        pr['BzrLogTail'] = ''.join(lines[-40:])
197
203
    finally:
218
224
            date_string))
219
225
    # be careful here that people can't play tmp-type symlink mischief in the
220
226
    # world-writable directory
221
 
    return os.fdopen(
 
227
    return filename, os.fdopen(
222
228
        os.open(filename, 
223
229
            os.O_WRONLY|os.O_CREAT|os.O_EXCL,
224
230
            0600),