paramiko SftpServer doesn't pass O_BINARY

Robey Pointer robey at lag.net
Fri Dec 2 02:34:04 GMT 2005


On 1 Dec 2005, at 18:09, John A Meinel wrote:

> In trying to test on Win32, I've been having problems with line-ending
> conversions.
>
> It turned out that the StubSFTPServer is actually converting the  
> lines.
> What happens is that paramiko/sftp_server.py never passes os.O_BINARY
>
> My workaround is as follows:

The workaround looks good.  This is my mistake, sorry.  SFTP declares  
all files to be in "binary mode", so a fake SFTP server should do the  
same.


> (Certainly the SftpTransport layer should treat everything as binary.
> Higher level operations may not want to)

This may be a general problem.  When "put"ing files across SFTP and  
HTTP, we're pushing bytes -- no line ending conversion will be done.   
So bzr can't ever assume that it will get line ending conversion from  
a transport.

robey





More information about the bazaar mailing list