pynfc icon indicating copy to clipboard operation
pynfc copied to clipboard

Crash when using poll_targets()

Open GoogleCodeExporter opened this issue 10 years ago • 0 comments

With the snippet:

mod_targets = (
    pynfc.Modulation(nmt=nfc.NMT_ISO14443A, nbr=nfc.NBR_UNDEFINED),
    pynfc.Modulation(nmt=nfc.NMT_ISO14443B, nbr=nfc.NBR_UNDEFINED),
)

targets = nfc.poll_targets(mod_targets, 20, 2)

=> crash with:

Traceback (most recent call last):
  File "testnfc.py", line 33, in <module>
    targets = nfc.poll_targets(mod_targets, 20, 2)
  File "pynfc.py", line 566, in poll_targets
    return self.initiator_poll_targets(*args, **kwargs)
  File "pynfc.py", line 366, in initiator_poll_targets
    targtypes[i] = targetlist[i]
TypeError: '_ctypes.PyCArrayType' object does not support item assignment


Patch attached.

Original issue reported on code.google.com by txprog on 27 Sep 2011 at 11:07

Attachments:

GoogleCodeExporter avatar Mar 20 '15 20:03 GoogleCodeExporter