pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.91k stars 383 forks source link

`file.put` fails if `dest` is a directory #663

Closed oz123 closed 3 years ago

oz123 commented 3 years ago

Describe the bug

Using files.put as:

files.put(
   src="/home/oz123/some.deb"
   dest='/home/oz123/'
   )

Results in the following error:

   [hostxxx] Command socket/SSH error: OSError('Failure',)

Which is pretty cryptic...

To Reproduce

Use as above.

Expected behavior

One can use files.put as with regular sftp or other unix commands mv, cp, which allow to ommit file name if the path is directory.

Meta


+ How was pyinfra installed (source/pip)?
```pip3 install pyinfra```

The issue is actually not with pyinfra, rather with paramiko (I have 2.7.2) see here https://github.com/paramiko/paramiko/issues/1000.
Fizzadar commented 3 years ago

Thank you for fixing this @oz123; this is now live in v1.4.15.