bytearray index out of range error in the dev-tags branch

Asked by Nick Ludlam

I'm getting the occasional exception when running "tagtool show" in your dev-tags branch. I don't know if this is a known issue, but wanted to flag it up anyway.

test@nfc-test:~/NFC/dev-tags$ python examples/ show
[nfc.clf] searching for reader with path 'usb'
[nfc.clf] using SCM Micro SCL3711-NFC&RW PN533v2.7 at usb:001:017
** waiting for a tag **
Type2Tag 'NXP NTAG203' ID=0438ADE2463480 ATQ=4400 SAK=00
Traceback (most recent call last):
  File "examples/", line 571, in <module>
  File "/home/test/NFC/dev-tags/examples/", line 283, in run
    while self.run_once() and self.options.loop:
  File "/home/test/NFC/dev-tags/examples/", line 278, in run_once
    return clf.connect(**kwargs)
  File "/home/test/NFC/dev-tags/nfc/", line 404, in connect
    result = self._rdwr_connect(rdwr_options, terminate)
  File "/home/test/NFC/dev-tags/nfc/", line 424, in _rdwr_connect
    if callback and callback(tag):
  File "examples/", line 308, in on_rdwr_connect
  File "examples/", line 329, in show_tag
    if tag.ndef:
  File "/home/test/NFC/dev-tags/nfc/tag/", line 217, in ndef
    if ndef.has_changed:
  File "/home/test/NFC/dev-tags/nfc/tag/", line 135, in has_changed
    old_data, self._data = self._data, self._read_ndef_data()
  File "/home/test/NFC/dev-tags/nfc/tag/", line 141, in _read_ndef_data
    if self._read_capability_data(tag_memory) == False:
  File "/home/test/NFC/dev-tags/nfc/tag/", line 125, in _read_capability_data
    if tag_memory[12] != 0xE1:
  File "/home/test/NFC/dev-tags/nfc/tag/", line 612, in __getitem__
    return self._data_in_cache[key]
IndexError: bytearray index out of range

Question information

English Edit question
nfcpy Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :

This is solved with revison 360 on branch dev-tags. Thanks for reporting.

Can you help with this problem?

Provide an answer of your own, or ask Nick Ludlam for more information if necessary.

To post a message you must log in.