New submission from Paul Winkler <sli...@gmail.com>:

If I have a directory that mostly contains distributions, but happens to also
contain a tarball that contains several packages (so it has multiple setup.py's,
and none at the top level), compoze currently dies with a not very useful error:

Traceback (most recent call last):
  File
"/home/pw/builds/slinktopp.openplans.org/builds/20090331/opencore/bin/compoze",
line 7, in ?
    sys.exit(
  File
"/home/pw/builds/slinktopp.openplans.org/builds/20090331/opencore/src/compoze/compoze/compozer.py",
line 127, in main
    compozer()
  File
"/home/pw/builds/slinktopp.openplans.org/builds/20090331/opencore/src/compoze/compoze/compozer.py",
line 114, in __call__
    command()
  File
"/home/pw/builds/slinktopp.openplans.org/builds/20090331/opencore/src/compoze/compoze/indexer.py",
line 145, in __call__
    self.make_index()
  File
"/home/pw/builds/slinktopp.openplans.org/builds/20090331/opencore/src/compoze/compoze/indexer.py",
line 167, in make_index
ValueError: need more than 0 values to unpack


Here's a trivial patch which at least lets it skip such tarballs.

----------
files: compoze.patch
messages: 155
nosy: slinkp
priority: bug
status: unread
title: compoze doesn't handle junk tarballs well

__________________________________
Repoze Bugs <b...@bugs.repoze.org>
<http://bugs.repoze.org/issue69>
__________________________________
Index: compoze/indexer.py
===================================================================
--- compoze/indexer.py	(revision 4078)
+++ compoze/indexer.py	(working copy)
@@ -260,7 +260,8 @@
                                              shell=True,
                                             )
                     output = popen.communicate()[0]
-                    return tuple(output.splitlines()[:2])
+                    result = tuple(output.splitlines()[:2])
+                    return result or (None, None)
                 finally:
                     shutil.rmtree(tmpdir)
             return None, None
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to