示例#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
 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()