Code Monkey home page Code Monkey logo

Comments (5)

remram44 avatar remram44 commented on July 3, 2024

The lib will read stderr on some occasions, passing it as argument to raised SCPExceptions, but otherwise the error output is not read. In fact, having the scp command print out verbose output could fill the receive buffer and freeze paramiko.

I'm trying to find a way for paramiko to log the stderr it gets, but there doesn't seem to be anything built in.

from scp.py.

nanomosfet avatar nanomosfet commented on July 3, 2024

So from the docs explaining the paramiko.client.SSHClient

Reads

client = SSHClient()
client.load_system_host_keys()
client.connect('ssh.example.com')
stdin, stdout, stderr = client.exec_command('ls -l')

I'm wondering if to solve this issue is it a simple fix of doing

def put and get
...

-    self.channel.exec_command(scp_command +
-                                  self.sanitize(asbytes(remote_path)))
+    stdin, stdout, stderr = self.channel.exec_command(scp_command +
+                                  self.sanitize(asbytes(remote_path)))

...

If you think that is an appropriate solution then let me know and I can make a pull request!

from scp.py.

remram44 avatar remram44 commented on July 3, 2024

This will give you pseudo-files you can read from instead of reading from the channel directly, but I'm no sure how it fixes the problem. PR welcome if you want to take a crack at it.

from scp.py.

nanomosfet avatar nanomosfet commented on July 3, 2024

@remram44 yeah I see what you are saying. The pseudo files can only be read after the exec_command finishes which doesn't really give us an up to date stdin.

from scp.py.

remram44 avatar remram44 commented on July 3, 2024

The pseudo files can only be read after the exec_command finishes

No that is not the case. I'm saying there's no difference doing stderr.read() over the current channel.recv_stderr().

from scp.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.