[issue13244] WebSocket schemes in urllib.parse

Tobias Oberstein report at bugs.python.org
Thu Oct 27 10:36:20 CEST 2011


Tobias Oberstein <tobias.oberstein at tavendo.de> added the comment:

The patch as it stands will result in wrong behavior:

+        self.assertEqual(urllib.parse.urlparse("ws://example.com/stuff#ff"),
+                         ('ws', 'example.com', '/stuff#ff', '', '', ''))

The path component returned is invalid for ws/wss and is invalid for any scheme following the generic URI RFC, since # must be always escaped in path components.

Is urlparse meant to follow the generic URI RFC?

IMHO, the patch at least should do the equivalent of

urlparse.uses_fragment.extend(wsschemes)

so users of urlparse can do the checking for fragment != "", required for ws/wss on their own.

----------

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


More information about the Python-bugs-list mailing list