![]() |
#1 |
cacoethes scribendi
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,686
Karma: 134000000
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Empty dc:language causing error in v1.9.20
I just upgraded from v1.9.2 to v1.9.20 and the first file I loaded gave me a series of "Embedded Python Error" when I tried to show the Metadata Editor.
Python Object Method Invocation Error: get_recognized_metadata Python Object Method Invocation Error: get_other_meta_xml Python Object Method Invocation Error: get_id_list Python Object Method Invocation Error: get_metadata_tag After which the Metadata Editor window shows up empty. The other epubs I tried seemed fine. This was an epub3 file. Some back and forth with between 1.9.2 (which can see and update the metadata) and 1.9.20 (which cannot) showed culprit to be this line out the metadata block in the .opf file: Code:
<dc:language/> I can supply the rest of the opf file if you want, but I don't think you should need it to reproduce the problem. It's a tradpub book, so I cannot share the original file in full. |
![]() |
![]() |
![]() |
#2 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 574
Karma: 1724081
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
|
I confirm.
1.9.10 allowed an empty dc:language tag. Maybe it's better to overwrite the empty tag with the default metadata language selection from Sigil settings when opening the metadata edit window? The specification still requires a language: Quote:
Last edited by BeckyEbook; 11-21-2022 at 07:10 AM. |
|
![]() |
![]() |
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,702
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Yes, mcontent being None here would cause an issue. I will test for that case and skip it if empty.
Passing in the sigil user interface language here would be a real pain as this parsing is being done in python here. I am not sure if the user interface language or default python locale lang would be a good bet either as books can be of any language really. Not sure what value to put here. Perhaps a translated string: UNSPECIFIED or some obvious filler value should be used to force the user to actually specify a valid language. Or force it to default to en. The spec is very clear and states there must be a value. Last edited by KevinH; 11-21-2022 at 11:45 AM. |
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,702
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Just checked the html xml:lang attribute and they now allow an empty string here when language is unknown. The epub xml spec does not allow the same for dc:language.
So some valid value from the language code list must be specified. |
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,702
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Okay, until I can figure out something better here, I have pushed a fix that "allows" a blank or empty dc:language tag when invoking the MetaEditor to prevent crashes. This effectively returns it to act like Sigil-1.9.10 in that one respect.
A need to check the xml and epub specs in more detail to see what if any fallbacks should be employed if any. This will prevent the Embedded Python Error. @gmw Thank you for your bug report! |
![]() |
![]() |
![]() |
#6 |
cacoethes scribendi
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,686
Karma: 134000000
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
I wondered whether the best way to resolve this might be to add relevant metadata checks to the check well-formed EPUB process. Or fix it at load as you do with the doctype check.
Simon & Schuster UK (the publisher in this case) obviously need to pick up their game. @KevinH Thank you for the continuing work on Sigil. |
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,702
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Unfortunately the doctype mend on open and epub well formed check only work on/check xhtml files not the OPF.
Doitsu's wonderful epubcheck plugin is how we recommend you validate a full epub including the OPF. If you check your input epub with epubcheck it should detect the missing dc:language value. |
![]() |
![]() |
![]() |
#8 | |
cacoethes scribendi
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,686
Karma: 134000000
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Quote:
You are, of course, correct. The epubcheck plugin does report that error, plus another from the opf. ERROR(OPF-014): The property "scripted" should be declared in the OPF file. ERROR(RSC-005): Error while parsing file: character content of element "dc:language" invalid; must be an RFC 3066 language identifier There were also errors in the ncx and nav.xhtml files. This is a new release ebook. It warms the heart to see how much care the traditional publishers take with their work. |
|
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,702
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Interesting: the need for "scripted" meansthatbook uses javascript on that file.
You should try running the Sigil Epub3 Tool menu command to "Update Manifest Properties" to fix that and any other missing or incorrect manifest properties. |
![]() |
![]() |
![]() |
#10 | |
cacoethes scribendi
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,686
Karma: 134000000
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Quote:
The epubcheck error reported in nav.xhtml is: ERROR(RSC-007): Referenced resource "js/kobo.js" could not be found in the EPUB. Seems that those two errors are related: When I used the Book Browser to edit nav.xhtml to remove reference to kobo.js, the scripted error went away too. |
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26,122
Karma: 181362750
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I've run into several kobo books that have had missing (but referenced JavaScript files) over the years.
|
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,702
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Now that you mention it. I have too. I wonder just what this unmanifested but referenced kobo.js actually is meant to do?
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26,122
Karma: 181362750
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I think it might be a remnant of the process used to create their .kepub files.
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Page edit - language list empty | C-novice | Sigil | 3 | 08-25-2022 02:44 PM |
File not empty error - please clarify | Smokva | Library Management | 8 | 07-21-2017 01:04 AM |
dc:language causing issues opening certain ePUBS on android | mightymouse2045 | Calibre | 7 | 11-21-2013 07:14 AM |
Error causing book deletion? | wygit | Conversion | 3 | 06-05-2012 09:11 PM |
Spine is empty error when converting | Ferrari328 | Calibre | 2 | 01-18-2011 09:42 AM |