Jack Diederich wrote:
> If folks like the way this partial set looks I'll convert the rest.

+1 from here (beautifying the standard lib was one of the justifications for 
partition, after all).

> ------------------------------------------------------------------------
> 
> Index: Lib/CGIHTTPServer.py
> ===================================================================
> --- Lib/CGIHTTPServer.py      (revision 51530)
> +++ Lib/CGIHTTPServer.py      (working copy)
> @@ -106,16 +106,9 @@
>      def run_cgi(self):
>          """Execute a CGI script."""
>          dir, rest = self.cgi_info
> -        i = rest.rfind('?')
> -        if i >= 0:
> -            rest, query = rest[:i], rest[i+1:]
> -        else:
> -            query = ''
> -        i = rest.find('/')
> -        if i >= 0:
> -            script, rest = rest[:i], rest[i:]
> -        else:
> -            script, rest = rest, ''
> +        (rest, sep, query) = rest.rpartition('?')
> +        (rest, sep, script) = rest.partition('/')
> +        rest = sep + rest # keep the slash

rest & script are back to front on the second line of the new bit.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to