jbardin/scp.py — pull request #41 by remram44 (2014-12-11 16:34:42+00:00)
Title: Fixes _send_recursive with multiple files

In `_send_recursive()`, `os.path.split()` doesn't do what it looks like (it splits any path in 2 components). This calls `_send_popd()` an incorrect number of times, which will make the server drop the connection.

Right now, sending two directories with `scp.put(['dir1', 'dir2'], '/tmp/', True)` fails with `socket.error: Socket is closed`.

This probably needs more tests. Version for my 'python3' branch is on -py3-recursive-popd`.