[issue6640] urlparse should parse mailto: URL headers as query parameters

Myk Melez report at bugs.python.org
Tue Aug 4 02:42:35 CEST 2009


New submission from Myk Melez <myk at mozilla.org>:

RFC 2368 <http://www.ietf.org/rfc/rfc2368.txt> specifies mailto: URLs as
having the following syntax:

     mailtoURL  =  "mailto:" [ to ] [ headers ]
     to         =  #mailbox
     headers    =  "?" header *( "&" header )
     header     =  hname "=" hvalue
     hname      =  *urlc
     hvalue     =  *urlc

The header fields in these URLs are roughly analogous to query
parameters in other URLs, but urlparse treats them as part of the path
(along with the email address):

>>> import urlparse
>>> urlparse.urlparse("mailto:foo at example.com?subject=hi")
ParseResult(scheme='mailto', netloc='',
path='foo at example.com?subject=hi', params='', query='', fragment='')

It should treat them as query parameters instead, which would not only
make it easier to access them but would also make it easier to access
the email address, since one would no longer have to parse headers, if
any, out of the path first.

----------
components: Library (Lib)
messages: 91249
nosy: mykmelez
severity: normal
status: open
title: urlparse should parse mailto: URL headers as query parameters
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6640>
_______________________________________


More information about the Python-bugs-list mailing list