~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/crash.py

  • Committer: Martin Pool
  • Date: 2010-02-02 10:13:33 UTC
  • mto: (4999.3.1 apport)
  • mto: This revision was merged to the branch mainline in revision 5002.
  • Revision ID: mbp@sourcefrog.net-20100202101333-zlhf25w3yb03yg5j
Don't call os.getuid on win32 (thanks gzlist)

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        # and then it should be private
191
191
        os.makedirs(crash_dir, mode=0600)
192
192
    date_string = time.strftime('%Y-%m-%dT%H:%M', time.gmtime())
193
 
    filename = 'bzr.%d.%s.crash' % (
194
 
        os.getuid(),
 
193
    # XXX: getuid doesn't work on win32, but the crash directory is per-user
 
194
    if sys.platform == 'win32':
 
195
        user_part = ''
 
196
    else:
 
197
        user_part = '.%d' % os.getuid()
 
198
    filename = 'bzr%s.%s.crash' % (
 
199
        user_part,
195
200
        date_string)
196
201
    return open(osutils.pathjoin(crash_dir, filename), 'wt')
197
202