Closed prunith closed 2 months ago
That is strange indeed. We did see this error on the builder for the documentation, but I could not reproduce locally. A fix is already committed on the master branch, you might want to try installing that.
If you can confirm this is fixed on master, we will make a new point release soon.
This is a strange error. I just retested with a fresh python 3.12.2 in virtual environment with the current master and I am not able to reproduce the error. Which version of canopen do you use?
Well, current master does include a fix. @prunith most likely tested with the latest PyPI release? That does not have the fix.
@acolomb you are right i use latest release 2.3.0 installed with pip and not the master.
I tried running a fresh 24.04 ubuntu docker container and installed system python3 (3.12.3) and made a venv and installed canopen from pypi in it. Still no failure.
There is something in your setup which I'm curious what triggers this.
Me too, curious. Because it didn't happen with the released version on my Ubuntu 24.04 with Python 3.12 either. But the same code failed on the readthedocs deployment (in context of Sphinx autodoc importing the modules). The fix is basically not relying on asterisk imports from the datatypes module, but pulling in the classes via name.
In my case i instelled IDLE python 12 for windows and installed package with pip command
From the path in the first post it seems you are installing canopen globally into the system and not via a virtual environment? @prunith
Yes but same issue occures with pycharm and venv based on installed python 12
fyi, I had this issue with Python 3.12 but when I upgraded to 3.12.4 it went away.
ISTM this can be closed as not-a-bug.
With python 3.12 i got error: File "C:\Users\100034799\AppData\Local\Programs\Python\Python312\Lib\site-packages\canopen\objectdictionary__init.py", line 281, in
class ODVariable:
File "C:\Users\100034799\AppData\Local\Programs\Python\Python312\Lib\site-packages\canopen\objectdictionary\ init__.py", line 290, in ODVariable
INTEGER24: IntegerN(24),
TypeError: Struct() argument 1 must be a str or bytes object, not int