Created attachment 814558 [details] Script to reproduce error. sci-libs/linux-gpib-4.3.4-r1 results in a SystemError when attempting to send data to a GPIB device. A version bump to sci-libs/linux-gpib-4.3.5 and sci-libs/linux-gpib-modules-4.3.5 fixes it, as noted in the release notes: https://sourceforge.net/projects/linux-gpib/files/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/4.3.5/ The only change necessary was to comment out the first patch ""${FILESDIR}/${P}-kernel-5.17.patch" in linux-gpib-modules-4.3.5.ebuild $ cat test.py #!/usr/bin/env python3 import pyvisa rm = pyvisa.ResourceManager("@py") resource_manager = pyvisa.ResourceManager() resources = list(resource_manager.list_resources()) try: resources.remove("ASRL/dev/ttyS0::INSTR") except ValueError: pass for resource in resources: print(resource) inst = rm.open_resource(resource) inst.query("*IDN?") $ ./test.py <snip> libgpib: invalid descriptor GPIB0::1::INSTR Traceback (most recent call last): File "/home/cfg/linux/hardware/gpib/py3.10_PY_SSIZE_T_CLEAN/./test.py", line 16, in <module> inst.query("*IDN?") File "/usr/lib/python3.10/site-packages/pyvisa/resources/messagebased.py", line 642, in query self.write(message) File "/usr/lib/python3.10/site-packages/pyvisa/resources/messagebased.py", line 197, in write count = self.write_raw(message.encode(enco)) File "/usr/lib/python3.10/site-packages/pyvisa/resources/messagebased.py", line 157, in write_raw return self.visalib.write(self.session, message)[0] File "/usr/lib/python3.10/site-packages/pyvisa_py/highlevel.py", line 543, in write written, status_code = self.sessions[session].write(data) File "/usr/lib/python3.10/site-packages/pyvisa_py/gpib.py", line 401, in write ifc.write(data) File "/usr/lib/python3.10/site-packages/Gpib.py", line 53, in write gpib.write(self.id, str) SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats # above test conducted with versions: $ emerge PyVISA PyVISA-py linux-gpib -pv1 These are the packages that would be merged, in reverse order: Calculating dependencies ... done! [ebuild R ] sci-libs/linux-gpib-4.3.4-r1::gentoo USE="firmware pcmcia python -doc -guile -perl (-php) -static -tcl" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9 -python3_11" 0 KiB [ebuild R ] dev-python/PyVISA-py-0.5.3::natinst USE="-doc -test" PYTHON_TARGETS="python3_10 -python3_8 -python3_9 -python3_11" 0 KiB [ebuild R ] dev-python/PyVISA-1.12.0::natinst USE="-doc -test" PYTHON_TARGETS="python3_10 -python3_8 -python3_9 -python3_11" 0 KiB
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=059e286ec5d5a10d3dac6e771e1d5a89eecad8dc commit 059e286ec5d5a10d3dac6e771e1d5a89eecad8dc Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2022-10-02 15:43:00 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2022-10-02 15:43:34 +0000 sci-libs/linux-gpib: Version bump Bug: https://bugs.gentoo.org/873382 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> sci-libs/linux-gpib/Manifest | 1 + sci-libs/linux-gpib/linux-gpib-4.3.5.ebuild | 181 ++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe7e76f2e53fa60d515458210c8d9ea049075145 commit fe7e76f2e53fa60d515458210c8d9ea049075145 Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2022-10-02 15:39:12 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2022-10-02 15:43:31 +0000 sci-libs/linux-gpib-modules: Version bump Bug: https://bugs.gentoo.org/873382 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> sci-libs/linux-gpib-modules/Manifest | 1 + .../linux-gpib-modules-4.3.5.ebuild | 69 ++++++++++++++++++++++ 2 files changed, 70 insertions(+)
Tested the fix/bump, it works. Good to close. TY!