Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 863494

Summary: dev-python/wxpython: incompatible with python3.10 (needs bump to 4.1.1)
Product: Gentoo Linux Reporter: Alex Orange <alex.orange>
Component: Current packagesAssignee: Gentoo wxWidgets project <wxwidgets>
Status: RESOLVED DUPLICATE    
Severity: normal CC: python
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=902205
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 823185    
Attachments: Updated ebuild to handle my 3.10 problems.
Patch to make sip work.
Backport to make a few things work in python3.10.

Description Alex Orange 2022-08-03 23:02:04 UTC
As description, it appears the use of __int__ deprecated in python 3.8 is now dead. wxpython before 4.1.0 still had some use of __int__ in things like WindowIDRef. Some of it's own classes like the Crust shell trigger this. In particular this is an issue with KiCAD.

Reproducible: Always

Steps to Reproduce:
1. emerge wxpython
2. emerge python:3.10
3. Run the following code:

import wx
from wx.py import crust
app = wx.App(redirect=False)
frame = wx.Frame(parent=None, id=wx.ID_ANY, title='Hello World')
crust_ = crust.Crust(parent=frame, intro="Hello")
frame.Show()
app.MainLoop()

Actual Results:  
Get the following trace:

Traceback (most recent call last):
  File "/home/alex/tmp/test_crust.py", line 5, in <module>
    crust_ = crust.Crust(parent=frame, intro="Hello")
  File "/usr/lib/python3.10/site-packages/wx/py/crust.py", line 43, in __init__
    self.shell = Shell(parent=self, introText=intro,
  File "/usr/lib/python3.10/site-packages/wx/py/shell.py", line 332, in __init__
    self.Bind(wx.EVT_MENU, lambda evt: self.CopyWithPrompts(), id=frame.ID_COPY_PLUS)
  File "/usr/lib/python3.10/site-packages/wx/core.py", line 1406, in _EvtHandler_Bind
    event.Bind(self, id, id2, handler)
  File "/usr/lib/python3.10/site-packages/wx/core.py", line 1477, in Bind
    target.Connect(id1, id2, et, function)
TypeError: EvtHandler.Connect(): argument 1 has unexpected type 'WindowIDRef'



Expected Results:  
Show a window with some sort of python command line thingy.

Following needs to be done:

Change wxpython-4.0.7* python_compat to:
PYTHON_COMPAT=( python3_{8..9} )

Get an ebuild for wxpython-4.1.1 so that we can move on with python3.10.
Comment 2 Alex Orange 2022-08-03 23:07:21 UTC
Given the depends that I just read, I should offer that another solution might be to see what kinds of issues like this exist and just backport some patches until whatever other versioning stuff gets worked out for the 4.1.x line.
Comment 3 Alex Orange 2022-08-10 17:03:21 UTC
Created attachment 799139 [details]
Updated ebuild to handle my 3.10 problems.

Ok, I've come up with a solution for my problems (2 patches, a BDEPEND on sip and running the sip phase of build). To be clear, I have **NOT** checked for any other possible python3.10 problems.
Comment 4 Alex Orange 2022-08-10 17:03:48 UTC
Created attachment 799141 [details, diff]
Patch to make sip work.

This was taken from debian.
Comment 5 Alex Orange 2022-08-10 17:04:42 UTC
Created attachment 799143 [details, diff]
Backport to make a few things work in python3.10.

Backport of wxpython fixes that exist in 4.1.0. I am **NOT** saying this is everything wrong for python3.10. It does fix my issue. There may be others.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-13 17:11:15 UTC

*** This bug has been marked as a duplicate of bug 766914 ***