paramiko SftpServer doesn't pass O_BINARY

John A Meinel john at arbash-meinel.com
Fri Dec 2 02:51:20 GMT 2005


Robey Pointer wrote:
> 
> 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.
> 

If that is the sftp spec, why doesn't Paramiko's SftpServer send
O_BINARY? Just because it is implied?

> 
>> (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.

I agree, the Transport layer should always just push bytes across, never
modify it.

I was just mentioning that we might do line conversions somewhere else
inside bzr. (I don't personally want to, I like keeping things binary,
but some people might persuade the group otherwise)

John
=:->

> 
> robey
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051201/b6bcd428/attachment.pgp 


More information about the bazaar mailing list