~mwhudson/apport/ignore-new-pycodestyle-warning

« back to all changes in this revision

Viewing changes to apport/hookutils.py

  • Committer: Brian Murray
  • Date: 2017-03-24 20:50:39 UTC
  • Revision ID: brian@canonical.com-20170324205039-6y7fm6cnyqkrmjks
Don't crash if .xsession-errors is not readable by the user.

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
    it can, and often does, contain sensitive and private data.
511
511
    '''
512
512
    path = os.path.expanduser('~/.xsession-errors')
513
 
    if not os.path.exists(path):
 
513
    if not os.path.exists(path) or \
 
514
            not os.access(path, os.R_OK):
514
515
        return ''
515
516
 
516
517
    if not pattern: