You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The openproof/inflate-op.tdl file of the ERG has a list with over 1000 items in it, and this is causing a recursion error:
>>> from delphin import tdl
>>> list(tdl.iterparse('openproof/inflate-op.tdl'))
Traceback (most recent call last):
[...]
File "/home/goodmami/delphin/pydelphin/delphin/tdl.py", line 207, in __setitem__
super(AVM, self).__setitem__(key, val)
File "/home/goodmami/delphin/pydelphin/delphin/tfs.py", line 58, in __setitem__
subdef[subkeys[1]] = val
File "/home/goodmami/delphin/pydelphin/delphin/tdl.py", line 204, in __setitem__
if not (val is None or isinstance(val, (Term, Conjunction))):
RecursionError: maximum recursion depth exceeded while calling a Python object
The list is flat, though, so it's probably not parsing that has a problem, but the list construction (REST.REST.REST.REST...).
The text was updated successfully, but these errors were encountered:
The offending TDL definition in the ERG seems to have been removed, and anyway this is not something I expect to occur in normal TDL files. A simple solution is to just increase the recursion limit while parsing, so I'm not going to do a proper fix for this and instead catch the RecursionError and provide a more informative error for the user.
I expect the situation to be so rare that I'd rather just punt and let
the user handle it. The solution is simple, so I make PyDelphin give
an error message to explain what to do.
Of course, this doesn't *really* solve the problem if they have a TDL
list with an obscene number of items that goes beyond the stack limit,
but I'll wait for the problem to arise before I try to solve it.
Resolves#294
The openproof/inflate-op.tdl file of the ERG has a list with over 1000 items in it, and this is causing a recursion error:
The list is flat, though, so it's probably not parsing that has a problem, but the list construction (
REST.REST.REST.REST...
).The text was updated successfully, but these errors were encountered: