예제 #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
 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
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()