kurtmckee/feedparser

Provide Better Instructions for Installing Feedparser on Python 3.x

Closed this issue · 1 comments

The current feedparser documentation states the following:

If you copied sgmllib.py from a Python 2.6 or 2.7 installation you’ll additionally need to edit the resulting file to remove the warnpy3k lines at the top of the file. There should be four lines at the top of the file that you can delete.

It would be nice to have some more specific copy-paste ready directions in that file. Below is a small script that I wrote that does it for Ubuntu installations, which is a start:

# Run 2 to 3 on the Python 2.7 version of sgmllib.py.
2to3 -wn -o . /usr/lib/python2.7/sgmllib.py
# Remove lines 11 to 15 that refer to warnpy3k and save it in the Python 3.5 directory.
sed '11,15d' sgmllib.py > /usr/local/lib/python3.5/dist-packages/sgmllib.py 
# Remove the temporary file.
rm sgmllib.py

@speedplane, I think this is addressed in the latest docs, which are currently going through beta testing.

As of now, feedparser has dropped Python 2 support and relies on the sgmllib3k package. It will be automatically installed and no additional work is required of users.