[Paramiko] win_pageant.py: change code to use ctypes instead of pywin32

Robey Pointer robey at lag.net
Wed Apr 11 18:26:59 BST 2007


Sorry it took me so long to reply to this!  My mail reader filed it  
into the bazaar folder because it was sent to the bazaar list, and  
I've fallen behind on reading that list.


On 10 Mar 2007, at 11:59, Alexander Belchenko wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Paramiko library allows us to use pageant on Windows.
> Pageant is brilliant thing for me, but I don't like
> how paramiko working with pageant.
>
> To talk with pageant paramiko used pywin32 library,
> but only part of big cool pywin32: win32ui module,
> that provide interface to MFC classes.
>
> Actually paramiko use only 2 functions from win32ui,
> and when packing win32ui to standalone bzr.exe
> we increase size of standalone application by 650KBytes,
> and this module also require additional library MFC71.dll
> with size about 1MBytes.
>
> Bad side effect: this dll is not present by default on many
> popular Windows system and I don't pack it to standalone
> installer. Another bad side effect: known trusted place
> to download this library (from Mark Hammond home page
> at starship.python.net) is now unavailable.
> Also there is recent security report from Microsoft
> that affect this library also.
>
> Long story short: I finally change internals of paramiko
> to use ctypes instead of pywin32. ctypes is the part of standard
> library since Python 2.5, it has very small size (~80KB) and we use
> it anyway in bzr.exe. I test it myself, and it work for me.
>
> Bundle attached.
>
> bzr branch http://bazaar.launchpad.net/~bialix/paramiko/ 
> paramiko.ctypes
>
> I will pack my version in next release of bzr.

That sounds good.  I didn't know much about the pywin32 library.  I  
think John's original patch used ctypes and someone complained  
because it was too new.

Since the code is nearly the same whether you use ctypes or pywin32,  
I think what I'm going to do for the next paramiko release is check  
for both (ctypes first, then pywin32) and use whichever one is  
found.  Does that sound okay?

robey




More information about the bazaar mailing list