Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Error Reporting: Temporary last open/save directory #1676

Merged
merged 2 commits into from
Oct 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Orange/canvas/application/errorreporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,17 @@ def _find_widget_frame(tb):
data[F.WIDGET_NAME] = widget.name
data[F.WIDGET_MODULE] = widget_module
if canvas:
filename = mkstemp(prefix='ows-', suffix='.ows.xml')[1]
fd, filename = mkstemp(prefix='ows-', suffix='.ows.xml')
os.close(fd)
# Prevent excepthook printing the same exception when
# canvas tries to instantiate the broken widget again
with patch('sys.excepthook', lambda *_: None):
canvas.save_scheme_to(canvas.current_document().scheme(), filename)
with patch('sys.excepthook', lambda *_: None), \
open(filename, "wb") as f:
scheme = canvas.current_document().scheme()
try:
scheme.save_to(f, pretty=True, pickle_fallback=True)
except Exception:
pass
data[F.WIDGET_SCHEME] = filename
with open(filename) as f:
data['_' + F.WIDGET_SCHEME] = f.read()
Expand Down