[Catalog-sig] Changes to the simple pages

P.J. Eby pje at telecommunity.com
Tue Jan 19 22:05:43 CET 2010

At 02:08 PM 1/19/2010 -0600, Ian Bicking wrote:
>On Mon, Jan 18, 2010 at 2:57 PM, "Martin v. Löwis" 
><<mailto:martin at v.loewis.de>martin at v.loewis.de> wrote:
>I would like to change the simple API in the following
>ways, within a few days:
>1. XML-escape href attributes to make the pages well-formed XML
>Â  (possibly other changes required for that as well, but I only
>Â  Â ran into lack of &amp;)
>2. Make file paths relative (from 
>Â  to ../../packages)
>This should be tested with easy_install/pip. Â I'm pretty sure 2 
>will be fine but 1 could break things if those clients aren't doing 
>unescaping. Â I'm pretty sure pip is not unescaping.

If you're using setuptools to do your PyPI access in pip, you are 
indeed unescaping.  ;-)  setuptools.package_index does full HTML 
entity decoding, including both named and numeric references, so XML 
escaping (which is a subset of that) should be just fine.

Likewise, #2 should be fine as long as urlparse.urljoin produces the 
correct result using the retrieved-from URL as the base URL.  I 
stress this because some web applications treat the urls "foo" and 
"foo/" as if they were interchangeable, and for relative-URL 
purposes, they are not.  So, as long as PyPI handles this correctly 
based on the URL that was sent by the *client* (rather than perhaps a 
canonical URL the client "should have" sent), then that will be fine. 

More information about the Catalog-SIG mailing list