doorstop-dev / doorstop

Requirements management using version control.
https://doorstop.readthedocs.io
Other
466 stars 128 forks source link

RecursionError: maximum recursion depth exceeded while calling a Python object #595

Closed villanella closed 1 year ago

villanella commented 1 year ago

I have one group of documents (requirements, use cases, tests) for each issue in the large project. When my Doorstop-project became bigger (40+ documents), I begin getting error on publishing project: "RecursionError: maximum recursion depth exceeded while calling a Python object", but html pages are successfully created. Is the error is caused by size of project? What number of docs are recommended?

Doorstop v3.0b4

# $ doorstop publish all ./public

home/myuser/.local/lib/python3.10/site-packages/doorstop/core/tree.py", line 573, in _iter_rows
    items = item.parent_items
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/item.py", line 612, in parent_items
    return [item for uid, item in self._get_parent_uid_and_item()]
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/item.py", line 612, in <listcomp>
    return [item for uid, item in self._get_parent_uid_and_item()]
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/item.py", line 603, in _get_parent_uid_and_item
    item = self.tree.find_item(uid)  # type: ignore
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/tree.py", line 440, in find_item
    log.trace("found cached item: {}".format(item))  # type: ignore
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/item.py", line 168, in __str__
    return str(self.uid)
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/item.py", line 389, in uid
    return UID(os.path.splitext(filename)[0])
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/types.py", line 125, in __init__
    self._prefix, self._number, self._name, self._exc = UID.split_uid(self.value)
  File "/home/myuser/.local/lib/python3.10/site-packages/doorstop/core/types.py", line 228, in split_uid
    m = re.match("([\\w.-]+)[" + settings.SEP_CHARS + "](\\w+)", value)
  File "/usr/lib/python3.10/re.py", line 190, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.10/re.py", line 290, in _compile
    if isinstance(flags, RegexFlag):
RecursionError: maximum recursion depth exceeded while calling a Python object
JustKnock commented 1 year ago

I will respond briefly with my experience on this matter. I had this error when there was a cyclic requirement trace (parent to child, and child to parent). I had a similar experience with document publishing-- I believe everything was published with the exception of the index file which hosted RTM matrix. This may not be your issue, but I would hate not to share if it was.

villanella commented 1 year ago

I will respond briefly with my experience on this matter. I had this error when there was a cyclic requirement trace (parent to child, and child to parent). I had a similar experience with document publishing-- I believe everything was published with the exception of the index file which hosted RTM matrix. This may not be your issue, but I would hate not to share if it was.

Thank you, I removed cyclic links and the error has disappeared.