Bug 868108 - Calibre: feedparse.py is an empty file
Calibre: feedparse.py is an empty file
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: calibre (Show other bugs)
17
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Kevin Fenzi
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 01:01 EDT by Claudio Saavedra
Modified: 2012-12-15 13:01 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-23 03:14:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Claudio Saavedra 2012-10-19 01:01:47 EDT
Calibre gives this error when trying to fetch news:

Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/web/feeds/news.py", line 1462, in parse_feeds
    get_article_url=self.get_article_url))
  File "/usr/lib64/calibre/calibre/web/feeds/__init__.py", line 320, in feed_from_xml
    from feedparser import parse
ImportError: cannot import name parse

However, this module is installed:

[claudio@localhost ~]$ python 
Python 2.7.3 (default, Jul 24 2012, 10:05:38) 
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from feedparser import parse
>>> 

[claudio@localhost ~]$ rpm -qa | grep feedparser
python-feedparser-5.1.2-2.fc17.noarch
python3-feedparser-5.1.2-2.fc17.noarch
[claudio@localhost ~]$ rpm -qa | grep calibre
calibre-0.9.1-1.fc17.x86_64
Comment 1 Kevin Fenzi 2012-10-19 16:01:26 EDT
Strange. 

I'll see if I can duplicate here...
Comment 2 Claudio Saavedra 2012-10-22 23:50:20 EDT
I've noticed that the "fetch news" feature works for some sources, like The Guardian. But I don't know whether that's because for this it doesn't use the feedparser. An example of one that fails is "Chile -> El Mostrador."

Hope this helps.
Comment 3 Gerhard Stenzel 2012-10-25 05:12:05 EDT
FWIW .. at least in my system the latest calibre RPM is faulty.

# ls -l /usr/lib64/calibre/calibre/web/feeds/feedparser.py
-rw-r--r-- 1 root root   0 Oct  6 19:45 /usr/lib64/calibre/calibre/web/feeds/feedparser.py

Note the "0"

One of many workarounds:

# yumdownloader --source calibre
# rpm -ivh calibre-0.9.1-1.fc17.src.rpm
# rpmbuild -ba ~/rpmbuild/SPECS/calibre.spec

Installed required devel rpms and repeat previous stop

# cp ~/rpmbuild/BUILD/calibre/src/calibre/web/feeds/feedparser.py.unbundle-feedparser /usr/lib64/calibre/calibre/web/feeds/feedparser.py

Try again to fetch news .. above worked for me
Comment 4 Claudio Saavedra 2012-10-25 16:32:14 EDT
Yes, that seems to be the problem. feedparser.py is an empty file.
Comment 5 Claudio Saavedra 2012-10-25 16:38:05 EDT
Then again, I think calibre is trying to use the system-installed feedparser (which is installed for me). For whatever reason is not finding it (python path issues?).
Comment 6 Kevin Fenzi 2012-10-30 19:16:54 EDT
Sorry for the delay here... I was off traveling. ;( 

If folks seeing this could try: 

install the fedora calibre package
rm -f /usr/lib*/calibre/calibre/web/feeds/feedparser.*

then run it and see if you can duplicate the crash. 

I'm wondering if the 0 length file is causing it problems...
Comment 7 Pete Travis 2012-10-30 23:51:44 EDT
Removing the feedparser packaged with calibre, as in comment #6, resolved this for me.
Comment 8 Fedora Update System 2012-10-31 00:57:57 EDT
calibre-0.9.4-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/calibre-0.9.4-1.fc18
Comment 9 Fedora Update System 2012-10-31 01:13:29 EDT
calibre-0.9.4-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/calibre-0.9.4-1.fc17
Comment 10 Fedora Update System 2012-10-31 14:12:45 EDT
Package calibre-0.9.4-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing calibre-0.9.4-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17364/calibre-0.9.4-1.fc18
then log in and leave karma (feedback).
Comment 11 Martin Tarenskeen 2012-11-13 02:43:00 EST
I'm still having problems related, I think, to this issue.
I have calibre-0.9.5-2.fc17 installed.
When I try to fetch news my system does not crash. That's the good news. The bad news is that when I open the fetched news to read it, I only see (almost) empty pages saying something like 

"Failed feed: Nieuws
No module named feedparser"

I have python-feedparser-5.1.2-2.fc17 installed however, but calibre can't find it?
Comment 12 Martin Tarenskeen 2012-11-13 02:55:39 EST
(In reply to comment #11)

> No module named feedparser"
> 
> I have python-feedparser-5.1.2-2.fc17 installed however, but calibre can't
> find it?

As a temporary fix I did

sudo cp /usr/lib/python27/site-packages/feedparser.py* /usr/lib/calibre/calibre/web/feeds/

and this works. So it indeed seems calibre is not finding feedparser
Comment 13 Kevin Fenzi 2012-11-15 15:27:27 EST
Martin: If you 'rm -f /usr/lib/calibre/calibre/web/feeds/feedparser*' you get the 'no module' error?

Are you sure you restarted calibre after upgrading?
Comment 14 Martin Tarenskeen 2012-11-15 17:29:46 EST
I don't think it will make much difference to do 'rm -f /usr/lib/calibre/calibre/web/feeds/feedparser*'. These files are already removed in calibre-0.9.5-2.fc15.rpm

But yes, still "no module named named feedparser".
Comment 15 Kevin Fenzi 2012-11-18 14:28:05 EST
ok, can you try this scratch build and see if it works correctly for you?

http://koji.fedoraproject.org/koji/taskinfo?taskID=4701207
Comment 16 Martin Tarenskeen 2012-11-18 15:09:31 EST
(In reply to comment #15)
> ok, can you try this scratch build and see if it works correctly for you?
> 
> http://koji.fedoraproject.org/koji/taskinfo?taskID=4701207

This one seems to be working fine. Feeds are fetched as expected. Thank you.
Comment 17 Kevin Fenzi 2012-11-18 15:46:19 EST
Excellent. Thanks for your testing (and patience). 

New updates on the way...
Comment 18 Fedora Update System 2012-11-18 15:50:09 EST
calibre-0.9.6-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/calibre-0.9.6-2.fc18
Comment 19 Fedora Update System 2012-11-18 16:04:41 EST
calibre-0.9.6-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/calibre-0.9.6-2.fc17
Comment 20 Fedora Update System 2012-11-23 03:14:51 EST
calibre-0.9.6-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 Fedora Update System 2012-12-15 13:01:01 EST
calibre-0.9.6-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.