PDFgui Linux/anaconda/wxpython-3 Bug & Patch

49 views
Skip to first unread message

michael...@diamond.ac.uk

unread,
Sep 30, 2015, 11:38:39 AM9/30/15
to diffp...@googlegroups.com
Hi,
I tried running pdfgui under anaconda python on Linux with wxpython-3.0.0.0 and encountered the following bug when I try to run the pdfgui executable in the bin directory:
<snip>
File "/scratch/tmp/diffpy/lib/python2.7/site-packages/diffpy.pdfgui-1.0_r6798_20120508-py2.7.egg/diffpy/pdfgui/gui/serverpanel.py", line 115, in __do_layout
hostGridSizer.Add((1, 1), 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
File "/dls_sw/apps/python/anaconda/1.7.0/64/lib/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 14456, in Add
return _core_.Sizer_Add(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at ./src/common/sizer.cpp(1401) in DoInsert(): too many items (5 > 2*2) in grid sizer (maybe you should omit the number of either rows or columns?)

It looks like adding a 5th item to hostGridSizer fails in wxpython 3+ (according to google!). I found the following solution, which seems to at least allow the program to start:
hostGridSizer = wx.GridSizer(2, 2, 0, 0) --> hostGridSizer = wx.GridSizer(0, 2, 0, 0)

GridSizer is also used in temperatureseriespanel.py, preferencespanel.py and dopingseriespanel.py.
- temperatureseriespanel.py should be OK as it expects 1x2 items and has 2 in it.
- preferencespanel.py should be OK as it expects 3x3 items and has 9 in it
- dopingseriespanel.py should be OK as it expects 1x2 items and has 2 in it.

Please find attached a suggested patch for serverpanel.py which should solve this bug (though i haven't tested extensively...).
Best,

Michael

--
Dr Michael Wharmby,
PDRA, I15-1

Tel.: +44(0)1235 77 8327
Email: michael...@diamond.ac.uk

--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

pdfgui_gridsizer.patch
Reply all
Reply to author
Forward
0 new messages