Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-30-2020, 12:30 AM   #1
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Help Please -Problem

I on Windows 10 enterprise and am using Calibre 5.0 and Sigil 1.10

I was tidying up an old ePub. I had just finished in Calibre Edit and the the ePub did not show any errors in Epubcheck or the Check Book tool.

I then tried to load the ePub into Sigil and got the following message

Quote:
Traceback (most recent call last):

File "C:/Prog1/Sigil/python3lib\opf_newparser.py", line 284, in get_package
(ver, uid, attr) = self.package

TypeError: cannot unpack non-iterable NoneType object
and Sigil would not open.

I then tried with another ePub in the series and got the same message BUT this time after I cancelled the message Sigil DID open the ePub. It did however give the message that there were problems opening the book.

Calibre Edit opens the files without problems.

Any Ideas?

Last edited by Thasaidon; 09-30-2020 at 12:32 AM. Reason: Typos and missed info
Thasaidon is offline   Reply With Quote
Old 09-30-2020, 06:32 AM   #2
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
There's been some refactoring done with opf_newparser.py (and changes to opf parsing in general) since Sigil 1.1.0. But it looks to me that Sigil can't quire determine whether it's an epub2 or epub3. Without a sample epub that exhibits the issue, that's about all I've got.

Last edited by DiapDealer; 09-30-2020 at 06:38 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 09-30-2020, 07:58 AM   #3
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by DiapDealer View Post
There's been some refactoring done with opf_newparser.py (and changes to opf parsing in general) since Sigil 1.1.0. But it looks to me that Sigil can't quire determine whether it's an epub2 or epub3. Without a sample epub that exhibits the issue, that's about all I've got.
Thanks for that DiapDealer.
I am in the Philippines and there are problems with the internet in my area so I do not know if I can manage to send you a copy of one of the files That is causing this problem.

I thought it was probably the OPF and have been fiddling. I found if I save the text files, stylesheet and cover and import them into a blank Sigil created epub. I have no further problems. So at least I can carry on working.

I will keep a copy of one of the books for when they fix the internet here and send it to you by PM..

KevinH said there would be a new version of Sigil soon so I was waiting for that before I upgraded.
Thasaidon is offline   Reply With Quote
Old 09-30-2020, 09:57 AM   #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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
No big changes in reading in from the opf ... but Sigil depends on knowing the opf version and the error does refer to the package tag being not-parseable. One quick thing that would help is to open it in Calibre and screenshot the opf in the Calibre Editor and post those screenshots here so that we can work on getting this fixed in time for the next release. Or even more simply, copy the bad epub and unzip that copy and manually extract the opf and post it here. That would probably be best.

Last edited by KevinH; 09-30-2020 at 10:00 AM.
KevinH is offline   Reply With Quote
Old 09-30-2020, 11:58 AM   #5
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Another thing that almost slipped my mind: with the Calibre version being brand new, and all. Please verify that you're not trying to open these problem epubs in Sigil using any of calibre's Open With functionality (inherent or plugin).

Or if you are, please try to open one of these epubs with calibre completely out of the equation.
DiapDealer is offline   Reply With Quote
Advert
Old 10-01-2020, 12:39 AM   #6
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by DiapDealer View Post
Or if you are, please try to open one of these epubs with calibre completely out of the equation.
Checked and it makes no difference.

As requested I have exported an OPF from one of the books and attached it to the post. If I have done it right.
Attached Files
File Type: opf content.opf (12.5 KB, 168 views)
Thasaidon is offline   Reply With Quote
Old 10-01-2020, 01:14 AM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,379
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
A quick look at the content.opf doesn't look quite right. Too many ns0:'s and other oddments that don't seem to belong there.
DNSB is online now   Reply With Quote
Old 10-01-2020, 04:55 AM   #8
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Thasaidon View Post
Checked and it makes no difference.

As requested I have exported an OPF from one of the books and attached it to the post. If I have done it right.
Yes, but I think still valid so this may be a bug in Sigil's opf parser.

In that opf they define a new namespace prefix ns0 that they assign for the default opf namespace and then therefore have to use it everywhere. Certainly not the most concise representation and notation but not incorrect xml as far as I can see.

This confuses the internal Sigil opf parser so I will have to fix that.

You can workaround this bug by doing the following to a copy of the opf file in any text editor. Ignore the single quotes, they are there just to delimit the strings.

1. Remove the unneeded prefix definition in the package tag by replacing

'xmlns:ns0="http://www.idpf.org/2007/opf"'

with:

'xmlns="http://www.idpf.org/2007/opf"'

2. remove the no longer needed prefix from the tag names by replacing all:

'<ns:'

with:

'<'

3. remove the no longer needed prefix from tag attributes by replacing all (notice the leading blank)

' ns0:'

with a single blank:

' '

Then save the changed opf and use it to replace the original one inside the epub zip.

I will work on tracking down why the lxml parser we use for pure xml files like the opf does not seem to simplify things properly.
KevinH is offline   Reply With Quote
Old 10-01-2020, 05:39 AM   #9
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by KevinH View Post
Yes, but I think still valid so this may be a bug in Sigil's opf parser.

In that opf they define a new namespace prefix ns0 that they assign for the default opf namespace and then therefore have to use it everywhere. Certainly not the most concise representation and notation but not incorrect xml as far as I can see.

This confuses the internal Sigil opf parser so I will have to fix that.
Thank you.

I will give your solution a try immediately.
Thasaidon is offline   Reply With Quote
Old 10-01-2020, 03:58 PM   #10
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay, I have tracked down how this case got through lxml without it cleaning up the namespaces.

The problem is the cleaning routine ignored properly well-formed xml (and your content.opf was actually well formed but using strange namespace prefixes) and so passed it through untouched and its strange namespace usage never got properly cleaned up.

I will modify the xmlprocessor.py code to even clean up namespaces in xml files that are opf's to prevent this problem from occurring again.

I will push this fix to master tomorrow after some more testing and it will appear in the very next release.

Thank you for your bug report!

KevinH
KevinH is offline   Reply With Quote
Old 10-01-2020, 07:51 PM   #11
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Just pushed a hopeful fix to master.

Thasaidon, when you get some time and better internet access, please pm me with a link to your problem epub to make sure my "fix" actually works.

Thanks.
KevinH is offline   Reply With Quote
Old 10-01-2020, 09:34 PM   #12
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by KevinH View Post
Just pushed a hopeful fix to master.

Thasaidon, when you get some time and better internet access, please pm me with a link to your problem epub to make sure my "fix" actually works.

Thanks.
Thank you.

Will do.

Another bug squashed.
Thasaidon is offline   Reply With Quote
Old 10-02-2020, 09:21 AM   #13
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by KevinH View Post
Just pushed a hopeful fix to master.

Thasaidon, when you get some time and better internet access, please pm me with a link to your problem epub to make sure my "fix" actually works.

Thanks.
Hi Kevin

Please find attached a copy of one of the problem books.

I thought I would give uploading a problem book a try. N.B. I have scrambled it but Sigil still gives the same error message when it opens it.

I tried to send it by PM but could not work out how to attatch it.


Thank you.
Attached Files
File Type: epub The Silent Death - Maxwell Grant_scrambled.epub (208.9 KB, 118 views)
Thasaidon is offline   Reply With Quote
Old 10-02-2020, 10:40 AM   #14
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks! The scrambled version is much appreciated.
DiapDealer is offline   Reply With Quote
Old 10-02-2020, 10:45 AM   #15
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
As DiapDealer said. Thank you for your scrambled test case. Using the very latest build, I was easily able to open this epub in Sigil.

BTW, it still gave warnings but these are real warnings related to wrong media types for ttf fonts that have nothing to do with the extra namespace ns0: in the OPF.

The opf is now properly cleaned up on load.

So we should be good to go with the next release.

Thanks,

KevinH

ps here are those warnings:
Quote:
The OPF uses an unrecognized media type "application/octet-stream" for file "LiberationSerif-Bold.ttf" - A temporary media type of "font/ttf" has been assigned. You should edit your OPF file to fix this problem.

The OPF uses an unrecognized media type "application/octet-stream" for file "LiberationSerif-BoldItalic.ttf" - A temporary media type of "font/ttf" has been assigned. You should edit your OPF file to fix this problem.

The OPF uses an unrecognized media type "application/octet-stream" for file "LiberationSerif-Italic.ttf" - A temporary media type of "font/ttf" has been assigned. You should edit your OPF file to fix this problem.

The OPF uses an unrecognized media type "application/octet-stream" for file "LiberationSerif-Regular.ttf" - A temporary media type of "font/ttf" has been assigned. You should edit your OPF file to fix this problem.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem! massive problem! Persian Calibre 8 07-13-2011 04:39 PM
PRS-500 battery problem, but the battery's not the problem ZachC Sony Reader 7 01-11-2010 11:46 PM
Calibré problem (may be XP problem) Hildebrandt Calibre 3 07-23-2009 02:04 PM


All times are GMT -4. The time now is 12:50 AM.


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