Greetings.

I am interested at advisory as to how to handle XMPP URI links.

This is how module "urllib" handles this type of URI.


urlparse
--------

from urllib.parse import urlparse

urlparse("xmpp:pubsub.python.i2p?;node=xmpp-python-news")

ParseResult(
  scheme='xmpp',
  netloc='',
  path='pubsub.python.i2p',
  params='',
  query=';node=xmpp-python-news',
  fragment='')

urlparse("xmpp:[email protected]?;node=urn:xmpp:microblog:0;item=xmpp-and-python")

ParseResult(
  scheme='xmpp',
  netloc='',
  path='[email protected]',
  params='',
  query=';node=urn:xmpp:microblog:0;item=xmpp-and-python',
  fragment='')

Hostname (netloc) should be "pubsub.movim.eu" and "python.i2p".


parse_qs
--------

Another issue, is not recognizing query parameters.

from urllib.parse import parse_qs

parse_qs("xmpp:[email protected]?;node=urn:xmpp:microblog:0;item=xmpp-and-python")

{'xmpp:[email protected]?;node': ['urn:xmpp:microblog:0;item=xmpp-and-python']}

The query parameters are not recorgnized unless the URI is formed in a similar
fashion to HTTP URI, which is not a valid XMPP URI.

parse_qs("xmpp://[email protected]/?node=urn:xmpp:microblog:0&item=xmpp-and-python")

{'xmpp://[email protected]/?node': ['urn:xmpp:microblog:0'], 'item': 
['xmpp-and-python']}


Request
-------

I would appreciate your advisory.


Kind reagrds,
Schimon
-- 
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to