Python bindings and a suggestion for improvement
Tomislav Ivek <[email protected]>
| Newsgroups | gmane.linux.hardware.gpib.general |
|---|---|
| Message-ID | <CAAgNE5=PXmJ2cg56nN7tUywyXtZ963ADBWk4cU3gDg_9KM4JRA@mail.gmail.com> |
The pure-Python VISA backend pyvisa-py has recently stumbled upon a double-close situation with linux-gpib's Python class Gpib.Gpib: https://github.com/pyvisa/pyvisa-py/pull/171 This bug is related to a design point in Gpib.Gpib which cleans up its GPIB handle only on Python's GC cycle. This is not guaranteed to run when the programmer expects it to and in extreme cases might even leak resources. It appears Gpib.Gpib has no other user-facing method to close its GPIB handle. This can be resolved by adding a Gpib.close() method for user-controlled cleanup. I hav ealready tested the fix in gpib_ctypes, a cross-platform GPIB binding that aims to be compatible with linux-gpib ( https://pypi.org/project/gpib-ctypes/). I would be happy to send a patch for linux-gpib's Python lib. Please let me know what you think about that. Tomislav _______________________________________________ Linux-gpib-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-gpib-general