$ cat foo.py
import ctags
from ctags import CTags, TagEntry
import sys
try:
tagFile = CTags('/tmp/tags')
except:
sys.exit(1)
print (tagFile['name'])
print (tagFile['author'])
print (tagFile['format'])
status = tagFile.setSortType(ctags.TAG_SORTED)
entry = TagEntry()
status = tagFile.first(entry)
if status:
print (entry['name'])
print (entry['kind'])
$ python ./foo.py
2
zsh: segmentation fault (core dumped) python ./foo.py
$
Could you consider the libreadtags used in python-ctags3 to v0.5.0 (https://github.com/universal-ctags/libreadtags/releases)?
The newer version fixes the bug reproduced with the following steps:
You can find /tmp/tags at https://raw.githubusercontent.com/universal-ctags/libreadtags/refs/heads/master/tests/too-many-fields.tags .