Ticket #5324 (closed: fixed)
Python does not initialize if a plugin has not loaded correctly
Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | major | Milestone: | Release 2.3 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Gesner Passos |
Description
On a recent Windows install this message was seen
I've just installed the Latest Stable Release 2.1.0-g6fbfbc4 announced a week ago. I uninstalled the previous Mantid via Control Panel as requested (actually I seemed to have 2 versions, a 64 bit Windows and a 32 bit Windows, both nightly builds). On starting up I get an error box "Failed to initialize Python - please contact support" and then the main Mantid window opens. In "Results Log" I have: Welcome to Mantid - Manipulation and Analysis Toolkit for Instrument Data Previous initialization of Python failed, cannot retry. And in "Scripting Console": Traceback (most recent call last): File "<string>", line 35, in <module> File "C:/MantidInstall/bin\MantidFramework.py", line 1195, in initialise import mantidsimple as _mantidsimple File "C:/MantidInstall/bin\mantidsimple.py", line 378, in <module> translate() File "C:/MantidInstall/bin\mantidsimple.py", line 374, in translate _algm_object = mtd.createUnmanagedAlgorithm(name, max(algorithm[1])) RuntimeError: Unknown property search object WhatKindOfWorld Error running init file "C:/MantidInstall/bin/mantidplotrc.py"
It turned out to be due to the user's UserAlgorithms dll being out of date with a new install. While we can do nothing about he plugin being out of date, Python should be able to load regardless and just warn an algorithm can't be used.
Change History
comment:3 Changed 8 years ago by Martyn Gigg
Catch algorithm init failures in Python. Refs #5324
So that MantidPlot can start even if a plugin algorithm, e.g. UserAlgorithms, does not initialize properly.
Changeset: dfa19727f91391048979a711432cbb304294e1dd
comment:4 Changed 8 years ago by Martyn Gigg
- Status changed from accepted to verify
- Resolution set to fixed
comment:5 Changed 8 years ago by Martyn Gigg
Catch algorithm init failures in Python. Refs #5324
So that MantidPlot can start even if a plugin algorithm, e.g. UserAlgorithms, does not initialize properly.
Changeset: dfa19727f91391048979a711432cbb304294e1dd
comment:6 Changed 8 years ago by Gesner Passos
- Status changed from verify to verifying
- Tester set to Gesner Passos
comment:7 Changed 8 years ago by Gesner Passos
- Status changed from verifying to closed
Tested in Windows 7 and Ubuntu 12.4, it successfully loads python if any algorithm does not load well, (I have simulated faulty algorithms inserting assert False entries in the good ones). There is just one place where the user algorithm can not fail, otherwise Mantid will not open, the place is def category(self).
If you insert a failure in this method, or return anything but string, Mantid will not open. Maybe this could be fixed after, but, as long the probability of being unable to correctly implement the category method is quite low, I vote for testing passed.
Moved at the end of release 2.2