Bible Module Errors

I am working with some Bible Modules to abridge some OT stories. I can create PDFs with regular Bible text, but trying to print out a Bible Module produced a list of errors instead of a PDF.PTXprint-module
Any help troubleshooting these?

Hi Brent, thanks for posting this issue. Could you please do a couple of things that might help us resolve it:
a) ensure you’re using the latest (ver 1.5.5) version - as we fixed a major bug just yesterday
b) If that doesn’t change what happens, then please send the Bible Module file to us at ptxprint[underscore]support@sil.org That might help us uncover what is going on.

I’m getting a very similar error with a Bible module:
PTXprint Version 1.5.6

Traceback (most recent call last):
File “ptxprint\gtkview.py”, line 651, in onOK
File “ptxprint”, line 137, in doit
File “ptxprint\runjob.py”, line 195, in doit
File “ptxprint\runjob.py”, line 195, in
File “ptxprint\runjob.py”, line 309, in dojob
File “ptxprint\texmodel.py”, line 683, in convertBook
File “ptxprint\texmodel.py”, line 636, in flattenModule
File “ptxprint\usfmutils.py”, line 445, in parse
TypeError: ‘NoneType’ object is not iterable

<class ‘TypeError’>: ‘NoneType’ object is not iterable

Hi Mark,
I’m still having this issue and am wondering if you ever found a fix for it. Thanks!

Hi Dan, Sorry that you are still struggling with this one. I had assumed that no news was good news, but now I know better. Please try this once more with the latest (version 1.5.14.1) and if it is still broken, then use the Create Archive button on the Advanced tab to make a ZIP file which you can send to us at ptxprint[underscore]support@sil.org. This is the easiest way for us to replicate the issue and then solve it for you.

Well, the latest version (1.5.14.3) still not working for me. Here’s the error message:

PTXprint Version 1.5.14.3

Traceback (most recent call last):
File “ptxprint\gtkview.py”, line 703, in onOK
File “ptxprint”, line 145, in doit
File “ptxprint\runjob.py”, line 188, in doit
File “ptxprint\runjob.py”, line 188, in
File “ptxprint\runjob.py”, line 307, in dojob
File “ptxprint\texmodel.py”, line 702, in convertBook
File “ptxprint\texmodel.py”, line 655, in flattenModule
File “ptxprint\usfmutils.py”, line 446, in parse
File “ptxprint\usfmutils.py”, line 511, in parse_element
File “ptxprint\usfmutils.py”, line 466, in parse_element
TypeError: expected string or bytes-like object

<class ‘TypeError’>: expected string or bytes-like object

This is the unchanged Bible module that I emailed to ptxprint_support last month.

Thanks for your patience, Brent. I now believe that this has been fixed (in ver 1.5.14.4) so you should be able to produce PDF output from Modules again now. Please let us know how it goes…

Still having a problem. Every module I try gets this error:
Canonicalise Text Error! Failed to flatten module text (due to a Syntax Error?): Check for USFM errors and/or problems with a module.

Strange indeed. Is that just a warning message, or a show-stopper? Does it produce a PDF or nothing at all?
Does it do anything different when you turn OFF the option called “Auto-Correct USFM” (in the “Other” section of the Advanced Tab)?

It’s a show stopper. Doesn’t make a PDF.
Tried turning off “Auto-Correct USFM” and same thing happened.

In the latest version 1.5.15 we have tried to make the error message more helpful. Let us know how it goes…

Could you please also ensure that the Paratext basic checks pass (without errors) for any scripture book(s) that the module is extracting verses from - otherwise PTXprint is going to choke and give you errors. For example, ensure that there’s a \p after the \c chapter and \s section headings, before the first \v verse starts.

Still having issues, but the error message is more specific now. Instead of “check for USFM errors”, it reads:
C:…01GENKon.SFM: line 1381,6: missing space after verse number ‘3M’

Ran basic checks for the portion that the module pulls from. It does come up with a lot of errors because I haven’t set up several of the parameters (punctuation followed by lower case, markers followed by lowercase, characters inventory, quotation rules, & repeated words come up as recommendations for completion). Which basic checks are most important for the purposes of this? I didn’t come up with any USFM errors except for not following /q2 with a capital letter.

I would say that the bare minimum would be:
image
And the Markers need to be valid for the whole book (not just the portions of text that you’re extracting from). The reason for this is that the whole book gets processed first and then the needed verses are extracted from that. So it doesn’t matter too much if there are chapters/verses missing, but whatever is there needs to be in good shape in order for us to process it for the module.

I don’t know if paratext basic checks detect this, but if you’ve got anything like one of the first two lines:

\v 1\somemarker shoudn't be part of the verse number
\v 2Nor should words
\v 3-4a Ranges are fine though, as long as you put a space after. 

With no space after the verse number, then although some programs don’t care at all, that is a guaranteed problem for PTXplus / XeTeX.
The second line above won’t crash XeTeX (I’m not sure about the Python front-end), but XeTeX will consider the verse number to be “2Nor” which probably isn’t what you want.

The fix is just put a space in there.

All the USFM documentation I’ve seen assumes there’ll be a space after the number, and the latest version explicitly states it should be there. Chapters and Verses — Unified Standard Format Markers 3.0.0 documentation

Came up with a handful of these in the book the module was from. In one place, there wasn’t a space between the verse number and the first word of the verse. That may have been the issue.
Also about 10 chapters didn’t have section headings and started without a \p marker and a few footnotes didn’t have closing \ft markers. Although I corrected these, I don’t suspect they were the issue.
I did have some empty verses, which I did not correct and did not prevent PTXprint from creating a PDF.

You said:

Then you said:

In one place, there wasn’t a space between the verse number and the first word of the verse. That may have been the issue.

To me that is a direct correlation.

It may not have been the only error, but it was one show stopper for sure.

Paratext is powerful. If you are typesetting with a Xetex based tool (PTXprint), then take the time to set up Paratext and use its power to clean up your text/syntax. Then your tool should work.

Your error would also come up in Schema check. Hold down shift while clicking on the Basic Check item and the Schema check shows up. Schema Checks can be scary, as one error can produce many error messages.