Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 393639 - dev-python/feedparser-5.1 version bump
Summary: dev-python/feedparser-5.1 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 16:36 UTC by Johan Bergström
Modified: 2012-01-03 04:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
feedparser-5.1.ebuild (feedparser-5.1.ebuild,2.53 KB, text/plain)
2011-12-08 16:36 UTC, Johan Bergström
Details
feedparser-5.1-sgmllib.patch (feedparser-5.1-sgmllib.patch,6.55 KB, patch)
2011-12-08 16:36 UTC, Johan Bergström
Details | Diff
feedparser-5.1.ebuild (feedparser-5.1.ebuild,2.12 KB, text/plain)
2011-12-08 20:05 UTC, Johan Bergström
Details
ebuild -5.1(-r1) patch and files/feedparser-test.patch combo (feedparser2.patch,1.42 KB, patch)
2011-12-10 17:55 UTC, Ian Delaney (RETIRED)
Details | Diff
feedparser-5.1-sgmllib.patch alternative (0001-Use-shipped-sgmllib-for-Python-3.x.patch,2.68 KB, patch)
2012-01-01 18:35 UTC, Sebastian Pipping
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Bergström 2011-12-08 16:36:37 UTC
Created attachment 295199 [details]
feedparser-5.1.ebuild

BUMP! This is an adaption of Arfrever's work in his overlay, so a big up to him!

Other fixes are mainly related to tests. See src_prepare for moar info (and upstream bugs). Additionally, use the built python path over pwd when running tests.

Finally, I've seen sporadic freezes when the test suite completes (the http server still persists). Haven't been able to track this down yet, but I recall not seeing the same issue in latest svn.

Please test!
Comment 1 Johan Bergström 2011-12-08 16:36:57 UTC
Created attachment 295201 [details, diff]
feedparser-5.1-sgmllib.patch
Comment 2 Johan Bergström 2011-12-08 20:05:34 UTC
Created attachment 295215 [details]
feedparser-5.1.ebuild

OK, new take. postinst/postrm was just broken (hat tip arfrever), src_install is redundant (hat tip arfrever) and added die's where needed.
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2011-12-09 09:36:15 UTC
ok; this

gentoo64 feedparser # emerge =dev-python/feedparser-5.1

yields

>>> Emerging (1 of 1) dev-python/feedparser-5.1
>>> Jobs: 0 of 1 complete, 1 running                Load avg: 1.50, 1.42, 1.30r
>>> Installing (1 of 1) dev-python/feedparser-5.1
success.  It's almost the same as emerge =dev-python/feedparser-5.1::progress.

It requires the ebuild in comment 2 and the patch from comment 1 by Johan.
Curiously 
gentoo64 feedparser # ebuild feedparser-5.1.ebuild clean test
draws error, but it's not the full 'monty' anyway.  emerge as above is.

The kicker; here's the hard part.

gentoo64 feedparser # mv ../../eclass/python.eclass ../../eclass/python.eclass-mv
gentoo64 feedparser # ln -s /var/lib/layman/progress/eclass/python.eclass ../../eclass/
gentoo64 feedparser # ls -ld ../../eclass/python.eclass
lrwxrwxrwx 1 root root 45 Dec  9 17:20 ../../eclass/python.eclass -> /var/lib/layman/progress/eclass/python.eclass

Without this, it fails, big time.  The python eclass again, and the mere mention of the history behind that makes any python dev 'blink', or is it squirm.  This holds the whole version bump to ransom
Comment 4 Johan Bergström 2011-12-09 09:45:53 UTC
I'm not sure i fully understood what you said, but the ebuild should work fine without the python eclass from progress. On the other hand, checking for PYTHON_ABI from postinst/postrm _does not_. I am yet to find a better solution. Anyone?
Comment 5 Ian Delaney (RETIRED) gentoo-dev 2011-12-10 11:34:27 UTC
currently the choice of either python eclass doesn't effect a pass of test phase.
I can't figure what is different in my system to cause this setup to not pass the test phase, but I persistently get 

ERROR: test_unicode_2 (__main__.TestOpenResource)
Traceback (most recent call last):
  File "feedparsertest.py", line 289, in test_unicode_2
    r = feedparser._open_resource(s, '', '', '', '', [], {})
  File "../build/lib/feedparser.py", line 2940, in _open_resource
    return open(url_file_stream_or_string, 'rb')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 20: ordinal not in range(128)
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2011-12-10 17:55:02 UTC
Created attachment 295399 [details, diff]
ebuild -5.1(-r1) patch and files/feedparser-test.patch combo

here is a more detailed description
  File "feedparsertest.py", line 289, in test_unicode_2
------------------------------------------------------
    return open(url_file_stream_or_string, 'rb')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 20: ordinal not in range(128)
Here is the test def

    def test_unicode_2(self):
        s = u'<feed><item><title>t\u00e9xt</title></item></feed>'
        r = feedparser._open_resource(s, '', '', '', '', [], {})
        self.assertEqual(s.encode('utf-8'), r.read())

s is  u'<feed><item><title>t\u00e9xt</title></item></feed>'
put this into a bpython or python

>>> s = u'<feed><item><title>t\u00e9xt</title></item></feed>'
>>> s
u'<feed><item><title>t\xe9xt</title></item></feed>'
>>> print(s)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/bpython/cli.py", line 1133, in write
    t = t.encode(getpreferredencoding())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 20: ordinal not in range(128)

The test is invalid.  It give it data that can't be handles by a python interpreter.  It has to go.  
Note it is test_unicode_2, there is already a 
test_unicode_1.

Note the ebuild patch does not obsolete the previous, but is a patch to the previous patch, simply adding 1 line of epatch the new files/feedparser-test.patch
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2011-12-21 15:08:40 UTC
cancel most of that. Turns out it is valid  My locale that's been set for months was in a state that confused python. Resetting it to one it liked saw the build become effective.  His patch is good to go
Comment 8 Johan Bergström 2011-12-22 06:07:10 UTC
I will submit a new ebuild as soon as the next version of feedparser is out.
Comment 9 Sebastian Pipping gentoo-dev 2012-01-01 18:35:56 UTC
Created attachment 297557 [details, diff]
feedparser-5.1-sgmllib.patch alternative

It seems that the error from 2to3 is not critical.
I would like to propose the attached patch for a more minimalistic alternative.

Does anyone know how to fix the test suite, at least for Python 2.x?
Comment 10 Johan Bergström 2012-01-01 19:05:44 UTC
(In reply to comment #9)
> Created attachment 297557 [details, diff] [details, diff]
> feedparser-5.1-sgmllib.patch alternative
> 
> It seems that the error from 2to3 is not critical.
> I would like to propose the attached patch for a more minimalistic alternative.
> 
> Does anyone know how to fix the test suite, at least for Python 2.x?

Yep. I've submitted multiple patches upstream. I would suggest waiting for the next release, but if we're in a hurry my patches are available in the upstream repo.
Comment 11 Mike Gilbert gentoo-dev 2012-01-03 04:21:55 UTC
I went ahead with this since net-misc/flexget insists on using >= 5.1. I did not include any of Johan's patches; you can ping me in IRC if you want me to add them.

+*feedparser-5.1 (03 Jan 2012)
+
+  03 Jan 2012; Mike Gilbert <floppym@gentoo.org> +feedparser-5.1.ebuild,
+  +files/feedparser-5.1-sgmllib.patch:
+  Version bump for bug 393639. Thanks to Johan Bergström and Arfrever. Includes
+  patch by sping. Fails tests.
+