Re: Python bindings and a suggestion for improvement
Tomislav Ivek <[email protected]>
| Newsgroups | gmane.linux.hardware.gpib.general |
|---|---|
| Message-ID | <CAAgNE5m-tUE=b-xNgNpohsW35VQzJu-q81TJwXfkufQJfeLq2A@mail.gmail.com> |
Great, thank you! Tomislav On Wed, Nov 28, 2018, 15:37 dave penkler <[email protected] wrote: > Patch applied. Thanks. > > On Wed, Nov 28, 2018 at 1:52 PM Tomislav Ivek <[email protected]> > wrote: > >> Hi Frank, thanks for the reply. Attached is the patch that introduces a >> safe Gpib.Gpib.close() which will ensure proper cleanup. Please take a look. >> >> Cheers, >> Tomislav >> >> >> On Wed, Nov 28, 2018 at 11:15 AM Frank Mori Hess <[email protected]> >> wrote: >> >>> On Tue, Nov 27, 2018 at 4:19 PM Tomislav Ivek <[email protected]> >>> wrote: >>> > >>> > 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. >>> >>> >>> I'm no python expert, but your change sounds reasonable to me. >>> >> _______________________________________________ >> Linux-gpib-general mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general >> > _______________________________________________ Linux-gpib-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-gpib-general