summaryrefslogtreecommitdiff
path: root/paramiko/sftp.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2165-int' into 3.0Jeff Forcier2023-01-161-2/+4
|\
| * Improve performance by reducing expensive bytes conversionAlex Gaynor2023-01-101-2/+4
| | | | | | | | | | | | In two core parts of the codebase, complex type-switch based code is used to convert a value to bytes. However, in all cases (except for one, fixed in this PR), the caller is specifying a Message instance. We can make this code much simpler by directly calling the correct method on Message. In #2110 this is measured to massively speed up large SFTP transfers.
* | No more (object)ionsJeff Forcier2023-01-161-1/+1
| |
* | Put back the old faux-long(), kinda, in a few spots onlyJeff Forcier2023-01-111-0/+10
|/
* Migrate some byte related helpers aroundJeff Forcier2023-01-091-3/+2
| | | | | I feel like we should be able to just nuke byte_chr and friends at this point, but it's not entirely obvious, so let's rock that boat later.
* Fix Free Software Foundation addressPaul Howarth2022-03-151-1/+1
| | | | They moved from Temple Place to Franklin Street in 2005.
* Bump black up to 18.6b4Jeff Forcier2018-08-221-1/+0
|
* Blacken under black 18.5b0Jeff Forcier2018-05-291-6/+2
|
* Blacken Paramiko on 2.4Chris Rose2018-05-171-60/+92
|
* Additional PEP8 fixes.Dorian Pula2017-05-311-10/+10
|
* Fix import * and a bunch of PEP8 formattingScott Maxwell2014-03-071-21/+18
|
* Changes inspired by the nischu7 branchScott Maxwell2013-11-011-1/+1
|
* More type conversionScott Maxwell2013-10-311-2/+2
|
* Convert and detect types properly, use helper constants, use StringIO and rangeScott Maxwell2013-10-301-2/+2
|
* Fix message sendingScott Maxwell2013-10-301-2/+3
| | | | Create constants for byte messages, implement asbytes so many methods can take Message and key objects directly and split get_string into get_text and get_binary. Also, change int handling to use mpint with a flag whenever the int is greater than 32 bits.
* Fixed a typo in the license header of most filesJeff Forcier2013-09-271-1/+1
| | | | | Conflicts: paramiko/proxy.py
* fix my email address to be the current one.Robey Pointer2009-07-191-1/+1
|
* [project @ robey@lag.net-20080706225842-25rg9uk9ksyxxbyf]Robey Pointer2008-07-061-2/+2
| | | | fix convoluted logging method
* [project @ robey@lag.net-20080323023616-fpo17kr0qxxbgthv]Robey Pointer2008-03-221-5/+1
| | | | | | | | bug 200416: don't create a new logger for every channel and every sftp client or server. it causes python to leak lots of useless logger objects, because they never go away. instead, log the channel # in the message, and use only a couple of standard log nodes.
* [project @ robey@lag.net-20070213191706-v8djxd4jiunb3his]Robey Pointer2007-02-131-1/+1
| | | | bump copyright year to 2007
* [project @ robey@lag.net-20061215211936-rgc3uzy5ai9h6qho]Robey Pointer2006-12-151-1/+6
| | | | | | bug 75370: notice garbage sftp packets since sftp packets shouldn't be larger than about 32k, if the first length byte is non-zero (ie, the packet size > 16M), raise an exception.
* [project @ robey@lag.net-20061113041742-e24468a63d31b8bd]Robey Pointer2006-11-121-1/+15
| | | | | | | sometimes the sftp module is used with raw sockets, not just paramiko Channels. in this case, calling recv() will never return. so notice this and use select() to give python a chance to notice a closed socket. this kind of thing is especially useful for unit tests.
* [project @ robey@lag.net-20060508002214-0403d95f73b152f5]Robey Pointer2006-05-071-1/+4
| | | | couple of doc fixes
* [project @ robey@lag.net-20060220005934-58d0df2920e799b5]Robey Pointer2006-02-191-1/+1
| | | | update copyright year
* [project @ robey@master-shake.local-20060126204925-3cc14de36a8c5c1f]Robey Pointer2006-01-261-4/+6
| | | | winscp doesn't like it if the server sends version info before the client does
* [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-65]Robey Pointer2005-10-131-5/+8
| | | | remove unnecessary shebangs, fix import lines to be explicit about imports from within paramiko, and a bit of whitespace cleanup
* [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-46]Robey Pointer2005-07-181-1/+6
| | | | add SFTPFile.check and server support (and test) -- it's an sftp extension that allows a client to retrieve the hash of part or all of a file without downloading it. we're probably the only ones who implement it yet
* [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-29]Robey Pointer2005-07-101-0/+2
| | | | a bunch of silly changes where i was trying to fix pychecker warnings before i decided it wasnt worth the effort
* [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-16]Robey Pointer2005-06-281-2/+0
| | | | forgot this one
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-154]Robey Pointer2005-02-281-1/+1
| | | | | | | even better 1.2 lapras re-bump the version # to 1.2 (with a new date since i added more stuff). add 2005 to the copyright date in a bunch of files.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-149]Robey Pointer2005-02-281-1/+1
| | | | | | | | | add thread ids to logs add a logging filter that reports the thread-id of the logger, and use that for all paramiko logging. since thread-local stuff didn't appear until python 2.4, i hacked up my own little version to assign incrementing numbers to threads as they log.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-141]Robey Pointer2005-01-251-1/+1
| | | | | | | | | misc logging fixes change the level of some log messages so interesting stuff gets logged at info instead of debug. fix an oops where channels defaulted to being in ultra debug mode, and make this mode depend on a new Transport method: "set_hexdump".
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-103]Robey Pointer2004-11-071-20/+52
| | | | | | rename sftp constants replace oddly named sftp constants (FX_OK for example) with names that make a bit more sense when sober (SFTP_OK).
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-85]Robey Pointer2004-09-111-263/+1
| | | | | move SFTPFile and SFTPAttributes into their own files move SFTPFile and SFTPAttributes into their own files.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-75]Robey Pointer2004-09-071-67/+164
| | | | | | | | | | | clean up SFTPAttributes add english descriptions to the FX_* error codes of sftp. clean up (and document) SFTPAttributes since it's exported now, and make it simple to generate one from a python os.stat object. make "_pythonize" the default -- that is, just use the same field names as python does for os.stat. (i'm not sure why i didn't do it that way in the first place; probably ignorance.) also add str() method that converts the SFTPAttributes into a string suitable for use in ls (used in an obscure way in sftp servers).
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-73]Robey Pointer2004-09-051-355/+30
| | | | | | | | | split sftp into sftp, sftp_client; renamed SFTP -> SFTPClient add sftp_client file, and split out the common code (sftp) from stuff specific to client mode (sftp_client). renamed SFTP class to SFTPClient, but left an alias so old code will still work. renamed a bunch of sftp constants now that they're better hidden from epydoc.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-70]Robey Pointer2004-09-031-3/+3
| | | | | | | | | | | | | clean up server interface; no longer need to subclass Channel - export AUTH_*, OPEN_FAILED_*, and the new OPEN_SUCCEEDED into the paramiko namespace instead of making people dig into paramiko.Transport.AUTH_* etc. - move all of the check_* methods from Channel to ServerInterface so apps don't need to subclass Channel anymore just to run an ssh server - ServerInterface.check_channel_request() returns an error code now, not a new Channel object - fix demo_server.py to follow all these changes - fix a bunch of places where i used "string" in docstrings but meant "str" - added Channel.get_id()
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-68]Robey Pointer2004-08-301-3/+15
| | | | | | | | | | | | added Transport.get_security_options() just something i wanted to play with: added Transport.get_security_options() which returns a SecurityOptions object. this object is a kind of proxy for the 4 "preferred_*" fields in Transport, and lets me avoid exposing those fields directly in case i change my mind later about how they should be stored. added some docs to Channel explaining that the request methods now return True/False, and fixed up docs in a few other places.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-65]Robey Pointer2004-08-271-52/+82
| | | | | | | | add settimeout/gettimeout/setblocking, some bugfixes. hide the command and response codes in sftp so they aren't exported. add settimeout/gettimeout/setblocking that just wrap calls to the underlying socket or channel. fix _read_all to not catch timeout exceptions.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-60]Robey Pointer2004-06-101-3/+15
| | | | | | | | | | | | | | | limit read/write requests to 32KB, advertise 32KB max packet size one of the unit tests was failing because the openssh sftp server was dropping the connection without any error. turns out they have a maximum allowed write size (possibly around 64KB). the sftp rfcs have a small hint that some servers may drop read/write requests of greater than 32KB. so, all reads are limited to 32KB, and all writes > 32KB are now chopped up and sent in 32KB chunks. this seems to keep openssh happy. also, we now advertise 32KB max packet size instead of 8KB (the speed improves a lot), and log when we read/write a packet. and sftp files are flushed on seek.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-51]Robey Pointer2004-05-171-2/+2
| | | | | | | | fix utf8, raise packet size, log exceptions, be more lax with sfp servers explicitly import utf8 encodings for "freezing" (and also because not all platforms come with utf8, apparently). raise the max acceptable packet size to 8kB, cuz 2kB was too low. log exceptions at error level instead of debug level. and don't reject older sftp servers.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-42]Robey Pointer2004-04-061-5/+5
| | | | | | | | | | | | | support py22, more or less add roger binns' patches for supporting python 2.2. i hedged a bit on the logging stuff and just added some trickery to let logging be stubbed out for python 2.2. this changed a lot of import statements but i managed to avoid hacking at any of the existing logging. socket timeouts are required for the threads to notice when they've been deactivated. worked around it by using the 'select' module on py22. also fixed the sftp unit tests to cope with a password-protected private key.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-30]Robey Pointer2004-03-081-2/+208
| | | | | | | | finish up client sftp support added 'stat' to SFTPFile and SFTP, documented 'open' and 'listdir', and added 'rmdir', 'lstat', 'symlink', 'chmod', 'chown', 'utime', 'readlink'. turned off ultra debugging now that the unit tests are all working.
* [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-27]Robey Pointer2004-03-041-0/+358
add BufferedFile abstraction SFTP client mode is mostly functional. there are probably still some bugs but most of the operations on "file" objects have survived my simple tests. BufferedFile wraps a simpler stream in something that looks like a python file (and can even handle seeking if the stream underneath supports it). it's meant to be subclassed. most of it is ripped out of what used to be ChannelFile so i can reuse it for sftp -- ChannelFile is now tiny. SFTP and Message are now exported. fixed util.format_binary_line to not quote spaces.