Closed capaulson closed 6 years ago
Not sure it will change anything but could update pyvisa-py to latest master.
This should be the latest master @MatthieuDartiailh. I just pulled the source yesterday.
Did you install from PyPI or directly from Github ? The current master (from Github) should indicate 0.3 for pyvisa-py version.
I have the same issue, using the pyvisa-py backend latest master.
python -m visa info returns:
Machine Details:
Platform ID: Windows-7-6.1.7601-SP1
Processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
Python:
Implementation: CPython
Executable: C:\workspace\agilent-u2000a-py\Scripts\python.exe
Version: 3.7.0
Compiler: MSC v.1914 64 bit (AMD64)
Bits: 64bit
Build: Jun 27 2018 04:59:51 (#v3.7.0:1bf9cc5093)
Unicode: UCS4
PyVISA Version: 1.9.1
Backends:
ni:
Version: 1.9.1 (bundled with PyVISA)
#1: C:\Windows\system32\visa64.dll:
found by: auto
bitness: 64
Vendor: Keysight Technologies
Impl. Version: 1377151778
Spec. Version: 5244928
#2: C:\Windows\system32\visa32.dll:
found by: auto
bitness: 64
Vendor: Keysight Technologies
Impl. Version: 1377151778
Spec. Version: 5244928
py:
Version: 0.3.0
ASRL INSTR:
Please install PySerial (>=3.0) to use this resource type.
No module named 'serial'
USB INSTR: Available via PyUSB (1.0.2). Backend: libusb1
USB RAW: Available via PyUSB (1.0.2). Backend: libusb1
TCPIP INSTR: Available
TCPIP SOCKET: Available
GPIB INSTR:
Please install linux-gpib to use this resource type.
No module named 'gpib'
Thanks for testing. I will investigate.
Added the following line before the call to 'issubclass' in sessions.py:
logger.debug('Type of %s %s', val, type(val))
This prints (before raising the error):
2018-08-31 11:49:11,825 - pyvisa - DEBUG - Type of <function Session.register_unavailable.<locals>._internal at 0x000000000A997B70> <class 'function'>
Hope this helps
Indeed yes ! The issue is that register_unavailable
actually stores a function instead of a class in the sessions dictionary. The fix should be easy, could you test the following ?
Replace:
def _internal(*args, **kwargs):
raise ValueError(msg)
_internal.session_issue = msg
by
class _internal(object):
session_issue = msg
def __init__(self, *args, **kwargs):
raise ValueError(msg)
Indeed this fixes the error. Now onto the next one :) (this one's with libusb though)
Could you submit a PR at some point ?
Thanks for the fix! Closing the issue.
The PR is now merged.
The issue:
My current configuration, all pulled from Git:
This works fine on 2.7 on my machine. Any ideas?