standardebooks / tools

The Standard Ebooks toolset for producing our ebook files.
Other
1.42k stars 125 forks source link

Non-deterministic behaviour of class generation in built epubs #364

Closed robinwhittleton closed 3 years ago

robinwhittleton commented 3 years ago

I ran a build of the Poe I’m working on and noticed that drama personas weren’t in small caps. I managed to narrow it down to the epub-type-z3998-persona class not being applied to the build ePub, but logging it shows that whether it’s applied or not is non-deterministic. Specifically, logging processed_xhtml for the specific short story I’m working on doesn’t always give the same results here: https://github.com/standardebooks/tools/blob/e5d0332a7d703c4ad49f39aac6771bf61b728420/se/se_epub_build.py#L258

I can’t see anything obvious that would cause this, but I’ll continue investigating. But worth filing an issue in case anyone else is seeing this / has a better idea what might be causing it?

(macOS 10.15.7, Python 3.9)

robinwhittleton commented 3 years ago

Notes from debugging (currently unresolved but progress at least). If I log current_class after https://github.com/standardebooks/tools/blob/e5d0332a7d703c4ad49f39aac6771bf61b728420/se/se_epub_build.py#L256

Which implies that the first-child code is somehow running after the epub-type-x code and overwriting it?