#43 PyPE does not work with wxpython3.0

v1.0_(example)
closed
None
1
2014-10-24
2014-08-26
anoteng
No

Pype fails to start with wxpython3.0:

[ Tue Aug 26 21:21:16 2014 ] /usr/share/pype/plugins/spellcheck.py:35: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
non_word.update(dict([(unichr(i), ' ') for i in xrange(256) if chr(i) not in goodch]))
Loading menus from /home/andreas/.pype/menus.txt
Loading history from /home/andreas/.pype/history.txt
Traceback (most recent call last):
File "/usr/bin/pype", line 1900, in loadHistory
self.config = unrepr(open(path, 'r').read())
File "/usr/share/pype/configuration.py", line 292, in unrepr
return Builder().build(getObj(s))
File "/usr/share/pype/configuration.py", line 240, in getObj
return compiler.parse(s).getChildren()[1].getChildren()[0].getChildren()[1]
File "/usr/lib/python2.7/compiler/transformer.py", line 51, in parse
return Transformer().parsesuite(buf)
File "/usr/lib/python2.7/compiler/transformer.py", line 128, in parsesuite
return self.transform(parser.suite(text))
File "<string>", line 1
a=
^
SyntaxError: invalid syntax
[ Tue Aug 26 21:21:16 2014 ] Traceback (most recent call last):
File "/usr/bin/pype", line 6258, in <module>
main()
File "/usr/bin/pype", line 6246, in main
filehistory.root = root = app.frame = MainWindow(None, -1, "PyPE", docs)
File "/usr/bin/pype", line 1423, in init
self.menubar.Check(MIDDLE_CL, MIDDLE_PASTE)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/core.py", line 12332, in Check
return _core
.MenuBar_Check(args, *kwargs)
wx._core.PyAssertionError: C++ assertion "item" failed at ../src/common/menucmn.cpp(991) in Check(): attempt to check an item which doesn't exist

Discussion

  • Josiah Carlson
    Josiah Carlson
    2014-08-26

    As a warning, this bug may never be fixed.

    I will try to take a look at it when I have some free time to see if the transition to wxPython 3.0 is easy enough.

     
  • Josiah Carlson
    Josiah Carlson
    2014-08-27

    I'll try harder to find time to fix it. Looking at the freeze timeline, it would seem that I should be targeting a pre-October 5 release, earlier being better. Is October 5 the right deadline I should be targeting?

     
  • Olly Betts
    Olly Betts
    2014-08-30

    October 5th isn't a bad target, but actually it just needs to be in testing on November 5th, which means it needs to be uploaded to unstable at least 10 days before that. That assumes that everything goes smoothing though, so an extra 3 weeks is a sensible safety margin.

    Only the last error looks to be wx-related to me. It's almost certainly happening with wx 2.8 too, it's just that wx 2.8 quietly suppresses such checks by default. You can make 3.0 do that for a quick fix, though actually making it not try to Check() non-existent menu items would be better. The README in the repo linked above shows how to suppress them with 3.0:

    http://anonscm.debian.org/cgit/collab-maint/wx-migration-tools.git/tree/README#n30

     
  • anoteng
    anoteng
    2014-09-01

    FYI. It is not necessary to make a new release if that's inconvenient. I can prepare a new Debian revision with a patch included.

     
  • Olly Betts
    Olly Betts
    2014-09-05

    The final message about the assertion failing is due to wx upstream now enabling WXDEBUG assertions by default - these pick up misuses of the wx API. You could turn them on in 2.8, but people rarely did, and some apps are very noisy with them. While it's good to address them, you can just tell 3.0 to handle them quietly like 2.8 did, which is at least a reasonable approach to get things working in the shorter term.

    The attached patch does that, and also updates usage of various constants and fixes a deprecation warning. These changes should all be OK with wxPython 2.8 too.

    This patch helps somewhat - with it pype at least starts up, but trying to open a .py file dies with:

    [ Fri Sep  5 20:24:06 2014 ] Traceback (most recent call last):
      File "/usr/bin/pype", line 1793, in OnDrop
        a = self.newTab(dn, fn, len(fnames)==1)
      File "/usr/bin/pype", line 849, in wrapper
        return method(self, *args, **kwargs)
      File "/usr/bin/pype", line 2565, in newTab
        self.control.AddPage(split, shortname, switch)
      File "/usr/share/pype/plugins/documents.py", line 333, in AddPage
        BaseNotebook.AddPage(self, page, text, switch, self.GNBI(which))
      File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 13619, in AddPage
        return _core_.BookCtrlBase_AddPage(*args, **kwargs)
    TypeError: in method 'BookCtrlBase_AddPage', expected argument 5 of type 'int'
    
     
    Attachments
  • Olly Betts
    Olly Betts
    2014-09-10

    Here's an updated patch which resolves the above (wxAuiNotebook's API is now much more similar to wxNotebook's API), and does away with the need to ignore wxdebug assertion failures.

    I'm not a pype user, so wider testing would be greatly appreciated.

     
    Attachments
  • Josiah Carlson
    Josiah Carlson
    2014-09-10

    Thank you for the patches. I'll give it a test on Windows this weekend.

     
  • Josiah Carlson
    Josiah Carlson
    2014-10-24

    I ended up committing a different patch, which works with both wxPython 2.8 and 3.0. Thank you for your work and help. :)

    Closing this bug now.

     
  • Josiah Carlson
    Josiah Carlson
    2014-10-24

    • status: open --> closed
    • assigned_to: Josiah Carlson