コード例 #1
0
 def _init_crashlogfile(self):
     """Start a new logfile and redirect faulthandler to it."""
     logname = os.path.join(standarddir.data(), 'crash.log')
     try:
         self._crash_log_file = open(logname, 'w', encoding='ascii')
     except OSError:
         log.init.exception("Error while opening crash log file!")
     else:
         earlyinit.init_faulthandler(self._crash_log_file)
コード例 #2
0
 def _init_crashlogfile(self):
     """Start a new logfile and redirect faulthandler to it."""
     logname = os.path.join(standarddir.data(), 'crash.log')
     try:
         self._crash_log_file = open(logname, 'w', encoding='ascii')
     except OSError:
         log.init.exception("Error while opening crash log file!")
     else:
         earlyinit.init_faulthandler(self._crash_log_file)
コード例 #3
0
ファイル: app.py プロジェクト: jrib/qutebrowser
 def _init_crashlogfile(self):
     """Start a new logfile and redirect faulthandler to it."""
     path = standarddir.get(QStandardPaths.DataLocation)
     logname = os.path.join(path, 'crash.log')
     try:
         self._crashlogfile = open(logname, 'w', encoding='ascii')
     except OSError:
         log.init.exception("Error while opening crash log file!")
     else:
         earlyinit.init_faulthandler(self._crashlogfile)
コード例 #4
0
ファイル: app.py プロジェクト: helenst/qutebrowser
 def _init_crashlogfile(self):
     """Start a new logfile and redirect faulthandler to it."""
     path = standarddir.get(QStandardPaths.DataLocation)
     logname = os.path.join(path, 'crash.log')
     try:
         self._crashlogfile = open(logname, 'w', encoding='ascii')
     except OSError:
         log.init.exception("Error while opening crash log file!")
     else:
         earlyinit.init_faulthandler(self._crashlogfile)
コード例 #5
0
 def _init_crashlogfile(self):
     """Start a new logfile and redirect faulthandler to it."""
     assert not self._args.no_err_windows
     data_dir = standarddir.data()
     if data_dir is None:
         return
     logname = os.path.join(data_dir, 'crash.log')
     try:
         self._crash_log_file = open(logname, 'w', encoding='ascii')
     except OSError:
         log.init.exception("Error while opening crash log file!")
     else:
         earlyinit.init_faulthandler(self._crash_log_file)
コード例 #6
0
ファイル: crashsignal.py プロジェクト: Olical/qutebrowser
 def _init_crashlogfile(self):
     """Start a new logfile and redirect faulthandler to it."""
     assert not self._args.no_err_windows
     data_dir = standarddir.data()
     if data_dir is None:
         return
     logname = os.path.join(data_dir, "crash.log")
     try:
         self._crash_log_file = open(logname, "w", encoding="ascii")
     except OSError:
         log.init.exception("Error while opening crash log file!")
     else:
         earlyinit.init_faulthandler(self._crash_log_file)
コード例 #7
0
def test_init_faulthandler_stderr_none(monkeypatch, attr):
    """Make sure init_faulthandler works when sys.stderr/__stderr__ is None."""
    monkeypatch.setattr(sys, attr, None)
    earlyinit.init_faulthandler()
コード例 #8
0
ファイル: test_earlyinit.py プロジェクト: vrama21/qutebrowser
def test_init_faulthandler_stderr_none(monkeypatch, attr):
    """Make sure init_faulthandler works when sys.stderr/__stderr__ is None."""
    monkeypatch.setattr(sys, attr, None)
    earlyinit.init_faulthandler()