avendesora / pythonbible

A python library for validating, parsing, normalizing scripture references and retrieving scripture texts (for open source and public domain versions)
https://docs.python.bible
MIT License
60 stars 12 forks source link

Error when getting KJV verse text for 41009038 (Mark 9:38) #12

Closed avendesora closed 4 years ago

avendesora commented 4 years ago

When attempting to get the KJV verse text for Mark 9:38 (verse_id = 41009038).

import pythonbible as bible
parser = bible.get_parser(version=bible.Version.KING_JAMES)
verse_text = parser.get_verse_text(41009038)
Traceback (most recent call last):
  File "<input>", line 3, in <module>
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 101, in get_verse_text
    paragraphs = _get_paragraphs(self.tree, self.namespaces, [verse_id], **kwargs)
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 132, in _get_paragraphs
    paragraph_element, verse_ids, current_verse_id, **kwargs
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 184, in _get_paragraph_from_element
    **kwargs,
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 242, in _handle_child_element
    return paragraph, skip_till_next_verse, new_current_verse_id
UnboundLocalError: local variable 'new_current_verse_id' referenced before assignment