[issue11862] urlparse.ParseResult to have meaningful __str__

Senthil Kumaran report at bugs.python.org
Mon Apr 18 15:16:31 CEST 2011


Senthil Kumaran <senthil at uthcode.com> added the comment:

Tomasz,

I think, you misunderstood the purpose of urlparse library. urlparse is for parsing the URL and into its components. The url could be a mailto:, svn+ssh or http,https. The requirement for parsing comes when you are designing systems which take up URL and you need to do parse it for certain purposes for your application and then do action based on the parsed result.  That is why there are parse,unparse,split, unsplit functions provided.

If you have to get the original url back it is reverse call, send the parsed result to urlunparse.

The urllib, which provides facilties for doing http at higher level provides you geturl (which is getting the url from the header values).

I don't see the use of __str__ or __unicode__ for parse library. I am closing this report as Invalid.

Thank you.

----------
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

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


More information about the Python-bugs-list mailing list