New submission from Petr Machek <petr...@seznam.cz>: Code:
import urllib.request class MyOpener(urllib.request.FancyURLopener): prompt_user_passwd = lambda x, y, z: ("username", "password") opener = MyOpener() page = opener.open("http://riddle.p4x.ch/music") print(page.readlines()) opener.open() call ends with error for every page requiring login via prompt_user_password(). urllib/request.py tries to encode password with base64 without conversion to bytes which is required for base64.b64encode() in Python 3.1. Even after applying conversion to bytes, another new error is generated ---------- components: Library (Lib) messages: 115269 nosy: petr6.6 priority: normal severity: normal status: open title: urllib.request.FancyURLopener won't connect to pages requiring username and password type: behavior versions: Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9725> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com