[Python-Dev] using openssh's pty code

J Raynor raynorj at mn.rr.com
Sun Sep 26 20:46:41 CEST 2004


I think I could improve the pty module by having it follow openssh's 
procedures, but I would wind up rewriting several configure checks in 
python, and I imagine some of them can only reliably be checked by 
compiling a small C program, like configure does.

I think the better solution would be to modify the C code in 
posixmodule.c, or to provide an alternate module (written in C).  For 
the alternate module idea, the pty module could import it and check to 
see if it provides openpty() (for example), just as the pty module 
currently tries to use os.openpty() before it tries its own 
implementation of openpty().


Martin v. Löwis wrote:
> J Raynor wrote:
> 
>>
>> Since openssh must handle pty allocation, its support for pty 
>> operations across various platforms is more robust than python's.  I'd 
>> like to use openssh's code to improve on python's pty handling.
>>
>> I know the licenses for openssh and python are different.  Can anyone 
>> tell me if it's legal to mix openssh code into python?  Assuming it 
>> is, are the python maintainers willing to accept a python patch that 
>> contains some openssh code?
> 
> 
> Could you change Python's pty module to more closely follow the
> procedures in OpenSSH, in particular those parts where OpenSSH
> is more robust?
> 
> Regards,
> Martin
> 


More information about the Python-Dev mailing list