mwalle / pyvxi11 Goto Github PK
View Code? Open in Web Editor NEWPure python VXI-11 library
License: GNU General Public License v3.0
Pure python VXI-11 library
License: GNU General Public License v3.0
HI,
I really appreciate the python-only VXI-11 implementation (especially after fighting for hours with assorted, broken, SWIG-based implementations).
I found an issue though with 64-bit machines...
Here's the traceback:
$ vxi11-cli ds1204b
Traceback (most recent call last):
File "/home/tymm/pyenvs/notebook/bin/vxi11-cli", line 9, in
load_entry_point('pyvxi11==0.3', 'console_scripts', 'vxi11-cli')()
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/vxi11_cli.py", line 60, in main
v.open()
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/vxi11.py", line 178, in open
self.vxi11_client.create_link(id(self), 0, 0, self.name)
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/vxi11.py", line 138, in create_link
self.unpacker.unpack_create_link_resp)
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/rpc.py", line 258, in make_call
pack_func(args)
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/vxi11.py", line 72, in pack_create_link_parms
self.pack_int(id)
File "/usr/lib/python2.7/xdrlib.py", line 57, in pack_int
self.__buf.write(struct.pack('>l', x))
struct.error: 'l' format requires -2147483648 <= number <= 2147483647
issue comes from interaction between code in Vxi11::open() and Vxi11Packer::pack_create_link_parms(), as the passed ID can exceed the value that can be stored in an int:
def open(self):
log.info('Opening connection to %s', self.host)
error, link_id, abort_port, max_recv_size = \
self.vxi11_client.create_link(id(self), 0, 0, self.name)
...
def pack_create_link_parms(self, params):
id, lock_device, lock_timeout, device = params
self.pack_int(id)
I threw together a quick hack without digging too deeply into the code; it's flawed I'm sure, but gets things working for me for now -- just mask off the high bits of the id. I imagine this will come back to bite me at some point.
self.vxi11_client.create_link(id(self) & 0x7fffffff, 0, 0, self.name)
If you have suggestions on a proper fix, would greatly appreciate it.
Thanks!
-Tymm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.