ebook-convert: Crash/File not found on CSS @import
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In Windows version of Calibre 5.x, a bug in the processing of @import rules in CSS files was introduced into ebook-convert:
1) File reader uses the path separators from the @import directive directly to query the filesystem, leading to files not found.
CSSImportRule: While processing imported style sheet href=../test2.css: OSError('Cannot read Stylesheet.')
If a backslash is used instead, the file will be found correctly, but it will violate the way paths are used in CSS.
2) In some cases, it is even possible to crash the whole process because it incorrectly enters an infinite loop. I suspect that the converter will completely ignore the "../" part and try to process whatever it finds.
It was OK in Calibre 4.x.
I am attaching a ZIP file with minimal examples of these bugs. In both cases, it is sufficient to call ebook-convert test.htm test.epub.
pepak
Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.
status fixreleased