[New-bugs-announce] [issue9725] urllib.request.FancyURLopener won't connect to pages requiring username and password

Petr Machek report at bugs.python.org
Tue Aug 31 19:05:37 CEST 2010


New submission from Petr Machek <petr6.6 at 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 <report at bugs.python.org>
<http://bugs.python.org/issue9725>
_______________________________________


More information about the New-bugs-announce mailing list