[New-bugs-announce] [issue16909] urlparse: add userinfo attribute

Olof Johansson report at bugs.python.org
Wed Jan 9 15:46:51 CET 2013

New submission from Olof Johansson:


The urlparse library's "netloc" attribute is today further split into the following attributes: username, password, hostname, port. The attributes preceding the @ (username, password) are refered to in RFC 3986 [1] as "userinfo", the format of which is scheme dependant. E.g. the (expired) internet draft for SSH/SFTP urls [2] have connection parameters within the userinfo (user;cparams at host).

In some cases, the deprecated "username:password" syntax is required to be supported even with, e.g. "connection parameters". For this reason, I propose a new attribute, "userinfo", that exposes the "raw" userinfo string, without any splitting on : etc. I've had a go at a patch, with updated unit tests and documentation. Any feedback is welcome!


1: http://tools.ietf.org/rfc/rfc3986.txt
2: http://tools.ietf.org/id/draft-ietf-secsh-scp-sftp-ssh-uri-04.txt

components: None
files: urlparse_userinfo.diff
keywords: patch
messages: 179447
nosy: olof
priority: normal
severity: normal
status: open
title: urlparse: add userinfo attribute
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file28649/urlparse_userinfo.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list