Bug 607782

Summary: Conversion to epub format fails
Product: [Fedora] Fedora Reporter: Andras Simon <szajmi>
Component: calibreAssignee: Kevin Fenzi <kevin>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: frankly3d, kevin, mbacovsk, mnowak, nushio, unixguy
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: calibre-0.7.38-3.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-22 20:29:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andras Simon 2010-06-24 19:19:05 UTC
Description of problem:

ebook-convert test.txt test.epub

fails with 

Traceback (most recent call last):
  File "/usr/bin/ebook-convert", line 19, in <module>
    sys.exit(main())
  File "/usr/lib/calibre/calibre/ebooks/conversion/cli.py", line 254, in main
    plumber.run()
  File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 919, in run
    self.opts, self.log)
  File "/usr/lib/calibre/calibre/ebooks/epub/output.py", line 160, in convert
    cm(self.oeb, self.opts, self.log)
  File "/usr/lib/calibre/calibre/ebooks/oeb/transforms/cover.py", line 85, in __call__
    self.insert_cover()
  File "/usr/lib/calibre/calibre/ebooks/oeb/transforms/cover.py", line 170, in insert_cover
    width, height = self.inspect_cover(href)
  File "/usr/lib/calibre/calibre/ebooks/oeb/transforms/cover.py", line 151, in inspect_cover
    if x.href == urlnormalize(href):
  File "/usr/lib/calibre/calibre/ebooks/oeb/base.py", line 322, in urlnormalize
    parts = urlparse(href)
  File "/usr/lib/python2.6/urlparse.py", line 108, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib/python2.6/urlparse.py", line 147, in urlsplit
    i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'

for every (including empty) text file test.txt.

Version-Release number of selected component (if applicable):

0.6.55-1.fc12

How reproducible:

always

Steps to Reproduce:

Run 

ebook-convert test.txt test.epub

with test.txt empty (or any text file)
 
Actual results:

Error message, as above

Expected results:

An epub file named test.epub

Additional info:

None.

Comment 1 Frank Murphy 2010-06-24 22:33:55 UTC
What version of python-cssutils are you running?

"rpm -q python-cssutils" will tell you.

Comment 2 Andras Simon 2010-06-25 00:37:22 UTC
python-cssutils-0.9.6-1.fc12.noarch

Comment 3 Frank Murphy 2010-06-25 09:45:55 UTC
This version of Calibre from Rawhide seems to fix that problem
http://koji.fedoraproject.org/koji/buildinfo?buildID=177286

Would you be willing to test it, if it doesn't pull in to much?

Comment 4 Leo 2010-06-28 18:22:46 UTC
I ran into this one as well.  I tried but couldn't install the f14 version of calibre you linked above - the dependency failures are below.

Is a possible solution to add a check for the minimum required version of python-cssutils to the calibre package?  I downgraded calibre to get it working while awaiting a fix: yum downgrade calibre

yum install calibre-0.7.1-2.fc14.x86_64.rpm 
Loaded plugins: fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirror.stanford.edu
 * rpmfusion-free: mirror.web-ster.com
 * rpmfusion-free-updates: mirror.web-ster.com
 * rpmfusion-nonfree: mirror.web-ster.com
 * rpmfusion-nonfree-updates: mirror.web-ster.com
 * updates: mirror.stanford.edu
Setting up Install Process
Examining calibre-0.7.1-2.fc14.x86_64.rpm: calibre-0.7.1-2.fc14.x86_64
Marking calibre-0.7.1-2.fc14.x86_64.rpm as an update to calibre-0.6.42-1.fc13.x86_64
Resolving Dependencies
--> Running transaction check
---> Package calibre.x86_64 0:0.7.1-2.fc14 set to be updated
--> Processing Dependency: libMagickCore.so.3()(64bit) for package: calibre-0.7.1-2.fc14.x86_64
--> Processing Dependency: libMagickWand.so.3()(64bit) for package: calibre-0.7.1-2.fc14.x86_64
--> Processing Dependency: libpodofo.so.0.8.1()(64bit) for package: calibre-0.7.1-2.fc14.x86_64
--> Processing Dependency: libpoppler.so.6()(64bit) for package: calibre-0.7.1-2.fc14.x86_64
--> Finished Dependency Resolution
Error: Package: calibre-0.7.1-2.fc14.x86_64 (/calibre-0.7.1-2.fc14.x86_64)
           Requires: libMagickCore.so.3()(64bit)
Error: Package: calibre-0.7.1-2.fc14.x86_64 (/calibre-0.7.1-2.fc14.x86_64)
           Requires: libMagickWand.so.3()(64bit)
Error: Package: calibre-0.7.1-2.fc14.x86_64 (/calibre-0.7.1-2.fc14.x86_64)
           Requires: libpoppler.so.6()(64bit)
Error: Package: calibre-0.7.1-2.fc14.x86_64 (/calibre-0.7.1-2.fc14.x86_64)
           Requires: libpodofo.so.0.8.1()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Comment 5 Kevin Fenzi 2010-06-28 20:17:41 UTC
>I ran into this one as well.  I tried but couldn't install the f14 version of
>calibre you linked above - the dependency failures are below.

Yes, this will not work. What version of fedora are you on? f12? f13?

>Is a possible solution to add a check for the minimum required version of
>python-cssutils to the calibre package?  I downgraded calibre to get it working
>while awaiting a fix: yum downgrade calibre

yes, it already has such a dep, but the problem is that 0.9.7 of python-cssutils which fixes this is not yet released, so we can't build it and get it to you. ;( 

They are on rc3, so hopefully it will be out soon and I will push updates as soon as it is built.

Comment 6 Leo 2010-06-28 20:34:59 UTC
I am running fedora 13.  If the dependency were for the correct version of python-cssutils, would that keep from updating calibre to a version that no longer works?  Wouldn't specifying minimum version of ptyhhon-cssutils >= 0.9.7 fix it?

In the meantime, I added "exclude=calibre*" to /etc/yum.conf after doing the "yum downgrade calibre".

Comment 7 Kevin Fenzi 2010-06-28 20:44:19 UTC
Yes, the Requires: python-cssutils >= 0.9.7 would fix this, but sadly as I mentioned there isn't a 0.9.7 final release version out yet. Only rc3, so we will need to wait until this ships to push it into fedora. 

You can also use a specific version in the exclude, so it will notice when there is a newer one. ie, 'exclude=calibre-0.6.55-1'

Comment 8 Leo 2010-06-28 21:42:13 UTC
Thank you for the exclude tip - I've added the version to it.

What I was wondering was if there was an exclude that would keep the version of calibre from installing without the corresponding python-css.  But I guess it would be even more confusing if yum update would then produce error messages that would confuse many people.  If the corresponding python-css was not yet available, would that result in error messages, or would it just not attempt to update calibre?

Thanks for all the hard work you guys do keeping the gazillion packages working!

Comment 9 Kevin Fenzi 2010-06-28 22:39:50 UTC
Well, it should work out fine because the next one I push out will have the dep on 0.9.7. ;)

Comment 10 Bug Zapper 2010-11-03 12:54:06 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 11 Kevin Fenzi 2010-11-03 18:23:02 UTC
Can you try this again with the latest f13 version?

Comment 12 Andras Simon 2010-11-03 18:39:37 UTC
(In reply to comment #11)
> Can you try this again with the latest f13 version?

I did, with the same result. That's why I incremented the version number.

Here's the backtrace after running 

ebook-convert test.txt test.epub

(I tried it both with empty test.txt and with one that has  a few ascii character in it) with a little context: 

Generating default cover
Failed to generate default cover
Traceback (most recent call last):
  File "/usr/bin/ebook-convert", line 19, in <module>
    sys.exit(main())  
  File "/usr/lib64/calibre/calibre/ebooks/conversion/cli.py", line 254, in main
    plumber.run()
  File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 919, in run
    self.opts, self.log)
  File "/usr/lib64/calibre/calibre/ebooks/epub/output.py", line 160, in convert
    cm(self.oeb, self.opts, self.log)
  File "/usr/lib64/calibre/calibre/ebooks/oeb/transforms/cover.py", line 85, in __call__
    self.insert_cover()
  File "/usr/lib64/calibre/calibre/ebooks/oeb/transforms/cover.py", line 170, in insert_cover
    width, height = self.inspect_cover(href)
  File "/usr/lib64/calibre/calibre/ebooks/oeb/transforms/cover.py", line 151, in inspect_cover
    if x.href == urlnormalize(href):
  File "/usr/lib64/calibre/calibre/ebooks/oeb/base.py", line 322, in urlnormalize
    parts = urlparse(href)
  File "/usr/lib64/python2.6/urlparse.py", line 108, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib64/python2.6/urlparse.py", line 147, in urlsplit
    i = url.find(':') 
AttributeError: 'NoneType' object has no attribute 'find'

Comment 13 Kevin Fenzi 2010-11-03 21:51:11 UTC
ok. Can you try again with the latest calibre from: 

http://repos.fedorapeople.org/repos/kevin/calibre/

Comment 14 Andras Simon 2010-11-03 23:10:58 UTC
(In reply to comment #13)
> ok. Can you try again with the latest calibre from: 
> 
> http://repos.fedorapeople.org/repos/kevin/calibre/

I get a different error with this:

[...]
Trimming unused files from manifest...
Traceback (most recent call last):
  File "/usr/bin/ebook-convert", line 19, in <module>
    sys.exit(main())
  File "/usr/lib64/calibre/calibre/ebooks/conversion/cli.py", line 254, in main
    plumber.run()
  File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 927, in run
    trimmer(self.oeb, self.opts)
  File "/usr/lib64/calibre/calibre/ebooks/oeb/transforms/trimmanifest.py", line 57, in __call__
    for href in cssutils.getUrls(item.data):
  File "/usr/lib64/calibre/calibre/ebooks/oeb/base.py", line 1062, in fget
    data = self._parse_css(data)
  File "/usr/lib64/calibre/calibre/ebooks/oeb/base.py", line 1008, in _parse_css
    import_rules = list(data.cssRules.rulesOfType(CSSRule.IMPORT_RULE))
AttributeError: 'CSSRuleList' object has no attribute 'rulesOfType'

(Just to make sure I tried the right version: it's calibre-0.7.24-1.fc13.x86_64)

Comment 15 Kevin Fenzi 2010-11-03 23:36:30 UTC
What version of python-cssutils do you have installed?

Comment 16 Andras Simon 2010-11-03 23:37:21 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > ok. Can you try again with the latest calibre from: 
> > 
> > http://repos.fedorapeople.org/repos/kevin/calibre/
> 
> I get a different error with this:

This was because I forgot to update python-cssutils to 0.9.7.
Now I did, and the error is gone. Thanks!

Comment 17 Andras Simon 2010-11-03 23:40:36 UTC
(In reply to comment #15)
> What version of python-cssutils do you have installed?

[We had a mid-air collision.] The one that caused the error was 0.9.6-1.

Comment 18 Kevin Fenzi 2010-11-03 23:43:10 UTC
ok, so it's working with that version fine?

I'm not sure I can easily upgrade f13, as thats a stable release and this version of calibre changes a lot of things. Will see what happens.

Comment 19 Andras Simon 2010-11-04 00:21:23 UTC
(In reply to comment #18)
> ok, so it's working with that version fine?

This bug is certainly gone.
 
> I'm not sure I can easily upgrade f13, as thats a stable release and this
> version of calibre changes a lot of things. Will see what happens.

Perhaps the fix to this bug could be backported?

Anyway, thanks for looking into this!

Comment 20 Fedora Update System 2011-01-13 00:08:00 UTC
calibre-0.7.38-3.fc14,python-cssutils-0.9.7-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/calibre-0.7.38-3.fc14,python-cssutils-0.9.7-1.fc14

Comment 21 Fedora Update System 2011-01-13 00:19:45 UTC
calibre-0.7.38-3.fc13,python-cssutils-0.9.7-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/calibre-0.7.38-3.fc13,python-cssutils-0.9.7-1.fc13

Comment 22 Fedora Update System 2011-01-13 23:25:59 UTC
calibre-0.7.38-3.fc13, python-cssutils-0.9.7-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update calibre python-cssutils'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/calibre-0.7.38-3.fc13,python-cssutils-0.9.7-1.fc13

Comment 23 Fedora Update System 2011-01-22 20:27:39 UTC
calibre-0.7.38-3.fc13, python-cssutils-0.9.7-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2011-01-22 20:31:35 UTC
calibre-0.7.38-3.fc14, python-cssutils-0.9.7-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.