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

InspectionTool crashes and cannot be recovered #2626

Open
komoto48g opened this issue Oct 19, 2024 · 0 comments
Open

InspectionTool crashes and cannot be recovered #2626

komoto48g opened this issue Oct 19, 2024 · 0 comments

Comments

@komoto48g
Copy link
Contributor

komoto48g commented Oct 19, 2024

Operating system: Windows 10
wxPython version & source: 4.2.2 (pypi)
Python version & source: 3.12

Description of the problem:
The wx.lib.inspection.InspectionTool crashed with Exception: "Bad perspective string" and cannot be displayed correctly again.

I haven't figured out what triggers this crash, but I found the workaround here:
https://discuss.wxpython.org/t/inspectiontool-crashes-every-time/25805

Deleting the registry entry: [HKCU\Software\wxpyinspector\perspective]
can solve this issue. However, an easier workaround would be preferable.

Traceback (most recent call last):
  ... (snip) ...
  File "C:\Python312\Lib\site-packages\wx\lib\inspection.py", line 105, in Show
    self._frame = InspectionFrame( parent=parent,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\wx\lib\inspection.py", line 201, in __init__
    self.LoadSettings(self.config)
  File "C:\Python312\Lib\site-packages\wx\lib\inspection.py", line 411, in LoadSettings
    self.mgr.LoadPerspective(perspective)
  File "C:\Python312\Lib\site-packages\wx\lib\agw\aui\framemanager.py", line 5291, in LoadPerspective
    pane = self.LoadPaneInfo(pane_part, pane)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\wx\lib\agw\aui\framemanager.py", line 5164, in LoadPaneInfo
    raise Exception("Bad perspective string")
Exception: Bad perspective string

For comparison, here is an example of a normal key string and an incorrect one that triggered a "Bad perspective string" exception:

[Good perspective]
layout2|name=info;caption=Object Info;minimode=1;state=134219520;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=200;besth=100;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=tree;caption=Widget Tree;minimode=1;state=134498300;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=280;besth=200;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=crust;caption=PyCrust;minimode=1;state=134481916;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=200;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=176|dock_size(4,0,0)=176|dock_size(3,0,0)=67|
[Bad perspective]
layout2|name=info;caption=Object Info;minimode=1;state=134219522;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=200;besth=100;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=tree;caption=Widget Tree;minimode=1;state=134481918;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=280;besth=200;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=crust;caption=PyCrust;minimode=1;state=134481918;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=200;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant