Under some circumstances I can't reproduce (switching/turning off
monitors?) it seems it's possible that SessionManager.save gets called
with last_window=True, without on_last_window_closed being called.
This might be to one of the Qt screen management bugs fixed in Qt 5.6,
which would explain why I can't reproduce it.
Instead of crashing, let's log the error and not save the session.
There are a lot of problems and flakiness with using a real clipboard.
Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.
Fixes#1285.
I tried to set my editor to `termite -e "vim -f {}"`, termite being a
pretty cool and light terminal I use within my i3wm Arch linux box.
So when I open my editor I want it to launch a terminal with Vim inside
instead of GVim for various reasons.
The validation rejected this at first because it was looking for '{}'
inside ['foo', 'bar', 'baz {}'], essentially. So I need it to look
inside the sub-strings, not just the list.
Then after validation I need to perform the '{}' replacement inside the
sub-string too, not just replacing the whole string.
This patch attempts to fix an issue where an error occuring in
misc/guiprocess or the editor process crashing would delete the
temporary file thus making it impossible to recover changes not commited
to the form field from the editor.
This hopefully helps with a crash on Windows which happens from time to time
during some multi-window tabs.feature tests:
Traceback (most recent call last):
File "...\mainwindow\mainwindow.py", line 446, in closeEvent
self._do_close()
File "...\mainwindow\mainwindow.py", line 405, in _do_close
objreg.get('session-manager').save_last_window_session()
File "...\misc\sessions.py", line 247, in save_last_window_session
self._last_window_session = self._save_all()
File "...\misc\sessions.py", line 183, in _save_all
win_data['geometry'] = bytes(main_window.saveGeometry())
RuntimeError: wrapped C/C++ object of type MainWindow has been deleted
If we don't do that, we can get this:
--- Logging error ---
Traceback (most recent call last):
File ".../python3.5/logging/__init__.py", line 984, in emit
self.flush()
File ".../python3.5/logging/__init__.py", line 964, in flush
self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>
Call stack:
[...]
File ".../qutebrowser/app.py", line 122, in qt_mainloop
return qApp.exec_()
File ".../qutebrowser/utils/objreg.py", line 118, in on_destroyed
log.destroy.debug("schedule removal: {}".format(name))
File ".../python3.5/logging/__init__.py", line 1267, in debug
self._log(DEBUG, msg, args, **kwargs)
File ".../python3.5/logging/__init__.py", line 1415, in _log
self.handle(record)
File ".../python3.5/logging/__init__.py", line 1425, in handle
self.callHandlers(record)
File ".../python3.5/logging/__init__.py", line 1487, in callHandlers
hdlr.handle(record)
File ".../python3.5/logging/__init__.py", line 855, in handle
self.emit(record)
File ".../python3.5/logging/__init__.py", line 984, in emit
self.flush()
File ".../python3.5/logging/__init__.py", line 964, in flush
self.stream.flush()
File ".../qutebrowser/misc/crashsignal.py", line 365, in interrupt
log.destroy.info("Do the same again to forcefully quit.")
Message: 'Do the same again to forcefully quit.'
Arguments: ()
For some reason this fails during teardown on OS X!?
File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/misc/ipc.py", line 357, in update_atime
path = self._server.fullServerName()
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/unittest/mock.py", line 895, in __call__
_mock_self._mock_check_sig(*args, **kwargs)
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/unittest/mock.py", line 107, in checksig
sig.bind(*args, **kwargs)
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/inspect.py", line 2652, in bind
return args[0]._bind(args[1:], kwargs)
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/inspect.py", line 2537, in _bind
param = next(parameters)
File "/Users/buildbot/buildbot/slave/osx/build/.tox/py34/bin/../lib/python3.4/_collections_abc.py", line 512, in __iter__
for key in self._mapping:
File "/Users/buildbot/buildbot/slave/osx/build/.tox/py34/lib/python3.4/collections/__init__.py", line 91, in __iter__
curr = root.next