ebook-convert: Crash/File not found on CSS @import

Bug #1901278 reported by pepak
6
This bug affects 1 person
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

Revision history for this message
pepak (liunchpad-net) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.