Skip to content

bytes_in_buffers does not work in simulation #93

@LongnoseRob

Description

@LongnoseRob

I am woking on a testbench with pyvisa-sim, and I found with the sim backend, instr.bytes_in_buffer for a simulate serial conenction does not work:

$python builds/locl/sim/sim_test.py 
LSG Serial #1234
Traceback (most recent call last):
  File "/home/robby/builds/locl/sim/sim_test.py", line 17, in <module>
    print(instr.bytes_in_buffer)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/robby/builds/pyvisa/pyvisa/attributes.py", line 175, in __get__
    return self.post_get(instance.get_visa_attribute(self.attribute_id))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/robby/builds/pyvisa/pyvisa/attributes.py", line 286, in post_get
    return int(value)
           ^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'object'

minimalist setup to reproduce:
sim_test.py.txt

Is there an easy way to have this functional in pyvisa-sim?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions