Giter Club home page Giter Club logo

Comments (2)

prokopto-dev avatar prokopto-dev commented on June 27, 2024

@lizaw : Consistently, despite the comment in the code (see sftp_client.SFTPClient.open()'s docstring/ documentation), you will find that people have better adding two arguments to the sftp.open

Try the following:

with sftp.open(sftp_root_dir+output_file_path, 'wb', 32768) as f:
  s3client.download_fileobj(s3_bucket, s3_key, f)

I have found that setting the buffer limit to 32kb and adding the binary flag does at times help with S3 connections, as mentioned on a few SO posts.

I know SSH by default transmits all data as binary, but I can't help feeling some implementations on hosts don't behave as expected.

from paramiko.

lizaw avatar lizaw commented on June 27, 2024

@prokopto-dev : I did try to put max buffer size in open(...) method and got same error. Per the known issue with download_fileobj:

download_fileobj with a file object in append mode can mess up file content #1446 - boto/boto3#1446

I do not know if the paramiko SFTP open file is conflicted with download_fileobj setting

from paramiko.

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.