Repository: pex-tool/pex

Issue:
Failure in running setup.py for a dependency leads to confusing error
```
Traceback (most recent call last):
  File "/ernestd/src/pex/dist/pex/.bootstrap/_pex/pex.py", line 271, in execute
  File "/ernestd/src/pex/dist/pex/.bootstrap/_pex/pex.py", line 320, in execute_entry
  File "/ernestd/src/pex/dist/pex/.bootstrap/_pex/pex.py", line 350, in execute_pkg_resources
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/bin/pex.py", line 467, in main
    pex_builder = build_pex(reqs, options, resolver_options_builder)
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/bin/pex.py", line 436, in build_pex
    resolveds = resolver.resolve(resolvables)
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/resolver.py", line 154, in resolve
    distributions[package] = self.build(package, resolvable.options)
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/resolver.py", line 203, in build
    dist = super(CachingResolver, self).build(package, options)
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/resolver.py", line 124, in build
    raise Untranslateable('Package %s is not translateable by %s' % (package, translator))
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/translator.py", line 50, in __str__
    return 'ChainedTranslator(%s)' % (', '.join(map(repr, tx) for tx in self._translators))
  File "/Users/edurbin/.pex/install/pex-1.0.0.dev0-py2.py3-none-any.whl.26c70bed807e428f3c64ac665ab11a241a8c0d08/pex-1.0.0.dev0-py2.py3-none-any.whl/pex/translator.py", line 50, in <genexpr>
    return 'ChainedTranslator(%s)' % (', '.join(map(repr, tx) for tx in self._translators))
TypeError: argument 2 to map() must support iteration
```



Discussion:

Resolving patch:
diff --git a/pex/translator.py b/pex/translator.py
--- a/pex/translator.py
+++ b/pex/translator.py
@@ -47,7 +47,8 @@ def translate(self, package, into=None):
         return dist
 
   def __str__(self):
-    return 'ChainedTranslator(%s)' % (', '.join(map(repr, tx) for tx in self._translators))
+    return 'ChainedTranslator(%s)' % (
+        ', '.join((tx.__class__.__name__ for tx in self._translators)))
 
 
 class SourceTranslator(TranslatorBase):


Test patch:
diff --git a/tests/test_translator.py b/tests/test_translator.py
--- a/tests/test_translator.py
+++ b/tests/test_translator.py
@@ -1,7 +1,7 @@
 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
 # Licensed under the Apache License, Version 2.0 (see LICENSE).
 
-from pex.translator import ChainedTranslator, TranslatorBase
+from pex.translator import ChainedTranslator, Translator, TranslatorBase
 
 try:
   import mock
@@ -32,3 +32,8 @@ def test_chained_translator_short_circuit_translate():
   assert initial_empty_translator.translate.called
   assert translator_with_value.translate.called
   assert not translator_after_value.translate.called
+
+
+def test_chained_translator_repr():
+  assert str(Translator.default()) == (
+      'ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)')