It looks like that with capnp 0.5.3 / current pycapnp from pip, the traversal limit setting from Python is broken.
The following code that attempts to access 500Mb file:
dataset = dataset_capnp.Dataset.read(open(sys.argv[1]), traversal_limit_in_words = 2^61)
Fails with:
Traceback (most recent call last):
File "./display.py", line 41, in <module>
dataset = dataset_capnp.Dataset.read(open(sys.argv[1]), traversal_limit_in_words = 2^61)
File "capnp/lib/capnp.pyx", line 2885, in capnp.lib.capnp._StructModule.read (capnp/lib/capnp.cpp:61419)
File "capnp/lib/capnp.pyx", line 3399, in capnp.lib.capnp._StreamFdMessageReader.__init__ (capnp/lib/capnp.cpp:68129)
capnp.lib.capnp.KjException: src/capnp/serialize.c++:179: failed: expected totalWords <= options.traversalLimitInWords; Message is too large. To increase the limit on the receiving end, see capnp::ReaderOptions.
stack: 0x7fd2148f1ec9 0x7fd2148f57ed 0x7fd214d84044 0x7fd2155980eb 0x5039eb 0x7fd2155965e2 0x499be5 0x4a1634 0x44e4a5 0x44ec9f 0x44f904 0x7fd2169eaec5 0x578c4e
Is there a way to disable traversal limit permanently for a given .capnp file? Or, if possible, disable it permanently across the library?
Thanks,
Dmitry
P.S. Having traversal limit doesn't make any sense at all for our application. We just read data from previously generated files....
P.P.S. Enabling it by default for 0.4 -> 0.5 had broken code for us. It was a nasty surprise.