Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2022, 05:42 AM   #1
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 5,673
Karma: 133740296
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/>
Shows as an empty Language entry in v1.9.2.

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.
gmw is offline   Reply With Quote
Old 11-21-2022, 07:08 AM   #2
BeckyEbook
Fanatic
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 567
Karma: 1680557
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:
The metadata section MUST include at least one language element with a value
EDIT: Probably this commit: https://github.com/Sigil-Ebook/Sigil...65272f905654e3

Last edited by BeckyEbook; 11-21-2022 at 07:10 AM.
BeckyEbook is offline   Reply With Quote
Advert
Old 11-21-2022, 11:06 AM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,569
Karma: 4500168
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.
KevinH is offline   Reply With Quote
Old 11-21-2022, 12:02 PM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,569
Karma: 4500168
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.
KevinH is offline   Reply With Quote
Old 11-21-2022, 12:44 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,569
Karma: 4500168
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!
KevinH is offline   Reply With Quote
Advert
Old 11-21-2022, 07:40 PM   #6
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 5,673
Karma: 133740296
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.
gmw is offline   Reply With Quote
Old 11-21-2022, 08:03 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,569
Karma: 4500168
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.
KevinH is offline   Reply With Quote
Old 11-22-2022, 01:16 AM   #8
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 5,673
Karma: 133740296
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
Quote:
Originally Posted by KevinH View Post
[...] 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.
Ah, now you're just reminding how long it has been since I've published anything. I hadn't bothered to keep the plugins going because for the last few years I've only been tweaking stuff I buy.

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.
gmw is offline   Reply With Quote
Old 11-22-2022, 09:26 AM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,569
Karma: 4500168
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.
KevinH is offline   Reply With Quote
Old 11-23-2022, 07:15 PM   #10
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 5,673
Karma: 133740296
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
Quote:
Originally Posted by KevinH View Post
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.
I tried "Update Manifest Properties" but that did not remove the error.

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.
gmw is offline   Reply With Quote
Old 11-24-2022, 09:28 AM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 25,924
Karma: 179532116
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.
DiapDealer is offline   Reply With Quote
Old 11-24-2022, 10:29 AM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,569
Karma: 4500168
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?
KevinH is offline   Reply With Quote
Old 11-24-2022, 11:32 AM   #13
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 25,924
Karma: 179532116
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.
DiapDealer is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 11:52 PM.


MobileRead.com is a privately owned, operated and funded community.