On Mon, Sep 01, 2014 at 07:36:29PM -0400, Liam Morland wrote:
> lkmorlan@burns:~$ wget --user=lkmorlan --password='<passwd>' -S 
> '<...>/mediawiki/api.php?action=feedrecentchanges&feedformat=atom'

Ah, the MediaWiki URL was enough of a hint for me to reproduce this
with my Wikipedia account [1].  The problem is the following line in
Feedparser [2]:

  auth = base64.standard_b64encode(user_passwd).strip()

which works in Feedparser's Python 2 but not in Python 3 (where
standard_b64encode expects a byte string [3]).  I'm not sure what the
appropriate charset for the user information is [4,5], but I don't
have any non-ASCII in my Wikipedia credentials, so:

  auth = base64.standard_b64encode(user_passwd.encode('ASCII')).strip()

worked for me.  If you're using Debian's python3-feedparser, you'll
want to file a bug with them [6] (although Etienne maintains both
python3-feedparser and rss2email for Debian, so you may not actually
need to file a new bug ;).

Cheers,
Trevor

[1]: 
https://<username>:<password>@en.wikipedia.org/w/api.php?action=feedrecentchanges&feedformat=atom
[2]: 
http://code.google.com/p/feedparser/source/browse/feedparser/feedparser.py?name=v5.1.3#2994
[3]: https://docs.python.org/3/library/base64.html
[4]: http://tools.ietf.org/html/rfc3986#section-3.2.1
[5]: http://tools.ietf.org/html/rfc2617#section-2
[6]: https://packages.debian.org/sid/python/python3-feedparser

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to