E.g. when running this integration test on Fabric where I stupidly neglected to set up an actual local agent first, we get:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/opt/python/2.6.9/lib/python2.6/threading.py", line 532, in __bootstrap_inner
File "/home/travis/virtualenv/python2.6.9/src/paramiko/paramiko/agent.py", line 114, in run
File "/home/travis/virtualenv/python2.6.9/src/paramiko/paramiko/agent.py", line 124, in _communicate
events = select([self._agent._conn, self.__inr], , , 0.5)
TypeError: argument must be an int, or have a fileno() method.
This is the same as Fabric #642.
Presumably we can just check for the value being handed to the select call to ensure it's not None or whatnot, and raise some more useful exception (or, possibly, just emit a log warning, though since this only happens on explicit attempts to forward an agent, it not functioning should probably be considered a stop-worthy error.)
This works for us; we were triggering this issue by running exec_command('ssh host command') from a cronjob.
Changelog fixes #402, closes #479