phillip.eby  committed d779c47

Backport fixes and doc updates; prep for 0.6c6 release

  • Participants
  • Parent commits 2015fd0
  • Branches setuptools-0.6

Comments (0)

Files changed (6)

File EasyInstall.txt

 below, and also the section on the `Package Index "API"`_.
+Password-Protected Sites
+If a site you want to download from is password-protected using HTTP "Basic"
+authentication, you can specify your credentials in the URL, like so::
+You can do this with both index page URLs and direct download URLs.  As long
+as any HTML pages read by easy_install use *relative* links to point to the
+downloads, the same user ID and password will be used to do the downloading.
 Controlling Build Options
  * Added ``--local-snapshots-ok`` flag, to allow building eggs from projects
    installed using `` develop``.
+ * Fixed not HTML-decoding URLs scraped from web pages
  * Fixed ``.dll`` files on Cygwin not having executable permisions when an egg


         dirname = ''
         for key in keys:
             if key in os.environ:
-                dirname = os.path.join(os.environ[key])
+                dirname = os.path.join(dirname, os.environ[key])

File pkg_resources.txt

  * Allow ``.egg-link`` files to contain relative paths.
+ * Fix cache dir defaults on Windows when multiple environment vars are needed
+   to construct a path.
  * Fix "dev" versions being considered newer than release candidates.

File setuptools.txt

 you use any option at all.
 (By the way, if you're using some other revision control system, you might
-consider submitting a patch to the ``setuptools.command.sdist`` module,
-so we can include support for your system.)
+consider creating and publishing a `revision control plugin for setuptools`_.)
+.. _revision control plugin for setuptools: `Adding Support for Other Revision Control Systems`_
 Making your package available for EasyInstall
  * Fix ``test`` command possibly failing if an older version of the project
    being tested was installed on ``sys.path`` ahead of the test source
+ * Fix ``find_packages()`` treating ``ez_setup`` and directories with ``.`` in
+   their names as packages.
  * Fix uploaded ``bdist_rpm`` packages being described as ``bdist_egg``

File setuptools/

         where,prefix = stack.pop(0)
         for name in os.listdir(where):
             fn = os.path.join(where,name)
-            if (os.path.isdir(fn) and
+            if ('.' not in name and os.path.isdir(fn) and
                 out.append(prefix+name); stack.append((fn,prefix+name+'.'))
-    for pat in exclude:
+    for pat in list(exclude)+['ez_setup']:
         from fnmatch import fnmatchcase
         out = [item for item in out if not fnmatchcase(item,pat)]
     return out

File setuptools/

         rels = map(str.strip, rel.lower().split(','))
         if 'homepage' in rels or 'download' in rels:
             for match in HREF.finditer(tag):
-                yield urlparse.urljoin(url,
+                yield urlparse.urljoin(url, htmldecode(
     for tag in ("<th>Home Page", "<th>Download URL"):
         pos = page.find(tag)
         if pos!=-1:
             match =,pos)
             if match:
-                yield urlparse.urljoin(url,
+                yield urlparse.urljoin(url, htmldecode(
 user_agent = "Python-urllib/%s setuptools/%s" % (
     urllib2.__version__, require('setuptools')[0].version
         if url.startswith(self.index_url) and getattr(f,'code',None)!=404:
             page = self.process_index(url, page)
         for match in HREF.finditer(page):
-            link = urlparse.urljoin(base,
+            link = urlparse.urljoin(base, htmldecode(
     def process_filename(self, fn, nested=False):
         # process an index page into the package-page index
         for match in HREF.finditer(page):
-            scan( urlparse.urljoin(url, )
+            scan( urlparse.urljoin(url, htmldecode( )
         pkg, ver = scan(url)   # ensure this page is in the page index
         if pkg:
             self.url_ok(url, True)   # raises error if not allowed
             return self._attempt_download(url, filename)
     def scan_url(self, url):
         self.process_url(url, True)
     def warn(self, msg, *args):
         log.warn(msg, *args)
+# This pattern matches a character entity reference (a decimal numeric
+# references, a hexadecimal numeric reference, or a named reference).
+entity_sub = re.compile(r'&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?').sub
+def uchr(c):
+    if not isinstance(c, int):
+        return c
+    if c>255: return unichr(c)
+    return chr(c)
+def decode_entity(match):
+    what =
+    if what.startswith('#x'):
+        what = int(what[2:], 16)
+    elif what.startswith('#'):
+        what = int(what[1:])
+    else:
+        from htmlentitydefs import name2codepoint
+        what = name2codepoint.get(what,
+    return uchr(what)
+def htmldecode(text):
+    """Decode HTML entities in the given text."""
+    return entity_sub(decode_entity, text)