paulscherrerinstitute / pcaspy

Portable Channel Access Server in Python
BSD 3-Clause "New" or "Revised" License
32 stars 24 forks source link

TypeError: in method 'PV_startAsyncWrite', argument 2 of type 'casCtx const &' #95

Closed hinxx closed 5 months ago

hinxx commented 6 months ago

I was trying out the asyn option on the PV and ran into this issue when doing caput -c MTEST:RAND 12:

python pcaspy/example/dummy.py

Traceback (most recent call last):
  File "/home/hinxx/ess/python/scan/.venv/lib/python3.10/site-packages/pcaspy/driver.py", line 578, in writeNotify
    self.startAsyncWrite(context)
  File "/home/hinxx/ess/python/scan/.venv/lib/python3.10/site-packages/pcaspy/cas.py", line 632, in startAsyncWrite
    return _cas.PV_startAsyncWrite(self, ctx)
TypeError: in method 'PV_startAsyncWrite', argument 2 of type 'casCtx const &'
python: ../Objects/typeobject.c:3818: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.
Aborted (core dumped)

I modified the dummy.py as follows:

pvdb = {
    'RAND' : {
        'prec' : 3,
        'asyn' : True
    },
}

I used the latest release.

hinxx commented 6 months ago

That solves it for me. Thanks!

xiaoqiangwang commented 5 months ago

0.8.1 is released with this fix