tomerfiliba/plumbum — pull request #135 by idanz (2014-07-01 06:07:25+00:00)
Title: Plumbum LocalModule does not respect getattr default value

e.g.
```
> getattr(sys.modules['plumbum.cmd'], 'x', None)
---------------------------------------------------------------------------
CommandNotFound Traceback (most recent call last)
in ()
----> 1 getattr(sys.modules['plumbum.cmd'], 'x', None)

/usr/local/lib/python2.7/dist-packages/plumbum/machines/local.pyc in __getitem__(self, cmd)
195 else:
196 # search for command
--> 197 return LocalCommand(self.which(cmd))
198 else:
199 raise TypeError("cmd must not be a RemotePath: %r" % (cmd,))

/usr/local/lib/python2.7/dist-packages/plumbum/machines/local.pyc in which(cls, progname)
166 if path:
167 return path
--> 168 raise CommandNotFound(progname, list(cls.env.path))
169
170 def path(self, *parts):

CommandNotFound: ('x', [, , , , , , , , ])
```

This can cause serious issues, for example, it breaks pickle.whichmodule.

To fix, plumbum should raise AttributeError if __getitem__ fails when called from __getattr__