Houston4444 / Patchance

Jack Patchbay GUI
GNU General Public License v2.0
28 stars 1 forks source link

OverflowError: Python int too large to convert to C long #8

Open Lukky56 opened 10 months ago

Lukky56 commented 10 months ago

I have error message : ModuleNotFoundError: No module named 'PyQt5.QtSvg' I install : apt install python3-pyqt5.qtsvg No error PyQt5

After new error message :

OverflowError: Python int too large to convert to C long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/share/patchance/src/patchance.py", line 50, in <module>
    from alsa_manager import AlsaManager
  File "/usr/local/share/patchance/src/alsa_manager.py", line 37, in <module>
    class AlsaPort:
SystemError: <built-in method __prepare__ of type object at 0x555e9b4369a0> returned a result with an exception set

My system : Linux Mint 21.3 32Go mem Qt5

Lukky56 commented 10 months ago

Sorry for my bad english. Thanks

Houston4444 commented 10 months ago

mmmh, could you please find the python3-pyalsa version package (if installed), and also the python3 version ?

moonshaadow commented 6 months ago

Hi @Houston4444 , I have the same error here on a Mint 21.3 system.

python3-pyalsa 1.1.6-3build1 Python 3.10.12

Please notice that Patchbay is working in RaySession.

Houston4444 commented 6 months ago

I can't test it, python3.10 -m pip install pyalsa fails, so I can't try, sorry.

Please notice that Patchbay is working in RaySession.

It's interesting because their code on this part is really near to be the same. It should be quite easy to find (or workaround) the issue, but I can't test, sorry.

moonshaadow commented 1 month ago

Hello @Houston4444 , Still stuck with this error. If I can perform some tests, please let me know how.

Houston4444 commented 1 month ago

@moonshaadow I really don't know. Perhaps it is something related to a wrong compilation of some source. This bug is very strange when I read the logs, It is just trying to prepare a very simple dataclass, and dataclass is part of the python standard library, so, nothing very special normally.

maybe you could try to run a simple python script with this contents:

from dataclasses import dataclass

@dataclass
class AlsaPort:
    name: str
    id: int
    caps: int
    physical: bool

    def pb_name(self, mode_str: str, client: 'AlsaClient'):
        return f":ALSA_{mode_str}:{client.id}:{self.id}:{client.name}:{self.name}"

print('ok')

Put this contents in a file ending with .py and run python3 ./THIS_FILE.py and see what happens. If nothing fails, you can also try:

from dataclasses import dataclass

from pyalsa import alsaseq
from pyalsa.alsaseq import (
    SEQ_USER_CLIENT,
    SEQ_PORT_CAP_NO_EXPORT,
    SEQ_PORT_CAP_READ,
    SEQ_PORT_CAP_SUBS_READ,
    SEQ_PORT_CAP_WRITE,
    SEQ_PORT_CAP_SUBS_WRITE,
    SEQ_PORT_TYPE_APPLICATION,
    SEQ_CLIENT_SYSTEM,
    SEQ_PORT_SYSTEM_ANNOUNCE,
    SEQ_EVENT_CLIENT_START,
    SEQ_EVENT_CLIENT_EXIT,
    SEQ_EVENT_PORT_START,
    SEQ_EVENT_PORT_EXIT,
    SEQ_EVENT_PORT_SUBSCRIBED,
    SEQ_EVENT_PORT_UNSUBSCRIBED,
    SequencerError
)

@dataclass
class AlsaPort:
    name: str
    id: int
    caps: int
    physical: bool

    def pb_name(self, mode_str: str, client: 'AlsaClient'):
        return f":ALSA_{mode_str}:{client.id}:{self.id}:{client.name}:{self.name}"

print('ok')

and if it fails in this case and not the previous one, then we can say there is something wrong with pyalsa.

moonshaadow commented 1 month ago

@Houston4444 None of those two scripts fails.

Houston4444 commented 1 month ago

@moonshaadow grrrr.

Are you sure the error is exactly this one ?

Traceback (most recent call last):
  File "/usr/local/share/patchance/src/patchance.py", line 50, in <module>
    from alsa_manager import AlsaManager
  File "/usr/local/share/patchance/src/alsa_manager.py", line 37, in <module>
    class AlsaPort:
SystemError: <built-in method __prepare__ of type object at 0x555e9b4369a0> returned a result with an exception set

which python version are you using now ?

moonshaadow commented 1 month ago

@Houston4444 The full error:

patchance
OverflowError: Python int too large to convert to C long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/share/patchance/src/patchance.py", line 50, in <module>
    from alsa_manager import AlsaManager
  File "/usr/local/share/patchance/src/alsa_manager.py", line 37, in <module>
    class AlsaPort:
SystemError: <built-in method __prepare__ of type object at 0x5fb071c459a0> returned a result with an exception set
python3 --version
Python 3.10.12
Houston4444 commented 1 month ago

I am sorry, I just installed python3.10 and pyalsa, and I can't reproduce the bug, and I really don't know what could be in cause. I suspect a problem with pyalsa package, I don't know which is the linux mint package, it may be different from the debian one.

Does patchance runs if you remove python3-pyalsa package ?

moonshaadow commented 1 month ago

Yes, I have removed this package. Patchance runs, but without the ALSA MIDI ports. "La bibliothèque ALSA python n'est pas présente ou trop ancienne. Assurez-vous d'avoir python3-pyalsa >= 1.2.4" Mint version is 1.1.6-3

moonshaadow commented 1 month ago

So my python3-pyalsa version is too old. Sorry to have bothered you, it is correctly documented in the INSTALL.md

I was not aware that Mint 22 was out. It uses python 3.12, which is needed to have newer version of python3-pyalsa. I'm considering to upgrade my system.

Houston4444 commented 1 month ago

Ok. Something is strange anyway:

Please notice that Patchbay is working in RaySession.

Good upgrade !

moonshaadow commented 1 month ago

I can confirm that with Mint 22 and python3-pyalsa 1.2.7 , patchance works as expected