BibleOrgSys icon indicating copy to clipboard operation
BibleOrgSys copied to clipboard

Error that's easily fixed

Open joshpetit opened this issue 2 years ago • 2 comments

Hey, I had this error:

Bible to USX v0.07
  This program comes with ABSOLUTELY NO WARRANTY.
  It is free software, and you are welcome to redistribute it under certain conditions.
  See the license in file 'gpl-3.0.txt' for more details.


Bible2USX: processing input folder '/home/joshu/Documents/bibleTranslations/nkjv_official/' …
USXXMLBible: Loading USX_1 books from /home/joshu/Documents/bibleTranslations/nkjv_official/USX_1/…
Loading 66 USX books using 11 processes…
  NOTE: Outputs (including error and warning messages) from loading various books may be interspersed.
Traceback (most recent call last):
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Apps/Bible2USX.py", line 157, in <module>
    run()
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Apps/Bible2USX.py", line 150, in run
    main()
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Apps/Bible2USX.py", line 114, in main
    loadedBible = unknownBible.search( autoLoadAlways=True, autoLoadBooks=True ) # Load all the books if we find any
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/UnknownBible.py", line 843, in search
    if autoLoad: return USXXMLBibleFileCheck( self.givenFolderName, strictCheck=strictCheck, autoLoad=autoLoad, autoLoadBooks=autoLoadBooks )
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Formats/USXXMLBible.py", line 152, in USXXMLBibleFileCheck
    if autoLoadBooks: uB.loadBooks() # Load and process the book files
                      ^^^^^^^^^^^^^^
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Formats/USXXMLBible.py", line 314, in loadBooks
    self.stashBook( UBB )
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Internals/InternalBible.py", line 965, in stashBook
    assumedBookNames = bookData.getAssumedBookNames()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Internals/InternalBibleBook.py", line 2943, in getAssumedBookNames
    results.append( BibleOrgSysGlobals.loadedBibleBooksCodes.getEnglishName_NR( self.BBB ) )
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joshu/apps/BibleOrgSys/BibleOrgSys/Reference/BibleBooksCodes.py", line 756, in getEnglishName_NR
    return self.__DataDicts['referenceAbbreviationDict'][BBB]['bookNameEnglishGuide'].split('/',1)[0].strip()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'bookNameEnglishGuide'

I went into the BibleBooksCode file and changed line 756 to this:

        return self.__DataDicts['referenceAbbreviationDict'][BBB]['nameEnglish'].split('/',1)[0].strip()

And it was able to export, it seems like the dictionary that it's trying to access looks like this:

{'referenceNumber': 1, 'SBLAbbreviation': 'Gen', 'OSISAbbreviation': 'Gen', 'SwordAbbreviation': 'Gen', 'CCELNumberString': '1', 'USFMAbbreviation': 'Gen', 'USFMNumberString': '01', 'USXNumberString': '001', 'UnboundCodeString': '01O', 'BibleditNumberString': '1', 'NETBibleAbbreviation': 'Gen', 'DrupalBibleAbbreviation': 'Gen', 'ByzantineAbbreviation': None, 'numExpectedChapters': '50', 'possibleAlternativeBooks': None, 'nameEnglish': 'Genesis / 1 Moses', 'typicalSection': 'OT'}

Not sure if this is an error on the files I'm trying to convert or a bug.

joshpetit avatar Oct 19 '23 11:10 joshpetit

Thanks for this. It puzzled me for a while and I can't find any error in the current codebase, so I suspect it might be because the version on PyPI needs updating (that's been on the Todo list for too long).

Just to double-check, can you please tell me how you obtained/downloaded the software? (i.e., did you use something like 'git clone' or did you use PyPI at all?)

RobH123 avatar Oct 19 '23 18:10 RobH123

I got it through git clone. But I'm not well versed in setting up venvs for python (which I had to do to get it to run) so may be accessing the pypi module not sure. Sorry I can't be of much help haha.

joshpetit avatar Oct 20 '23 11:10 joshpetit