Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 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()