Brandon Craig Rhodes added the comment:

Kristján, your patch is a wonderful idea—I am about to commit production code 
that will have to create tens of thousands of temporary files during operation, 
one file each time SSL is started up on a socket, which could be avoided if 
something like this patch were applied. I had always assumed that it was simply 
a limitation of the underlying SSL library! An interface that takes a filename 
like this, instead of a live file-like object, seems so un-Pythonic that I 
assumed the only reason for it was a limitation in OpenSSL. Thank you very much 
for looking under the covers and discovering that this was not the case!

I do, though, feel a slight twinge when we add Even More Parameters to a 
Standard Library routine but in such a way that it cannot be used with an 
existing parameter — as here in your patch, where we gain a parameter like 
`certdata` that cannot be (should not be?) used at the same time as `certfile`. 
It seems redundant to have two names for the same parameter to the underlying 
library, and makes it look like the routine needs more information than it 
really does.

Since my own instinct was to think, ten minutes ago, "Maybe I can pass a 
StringIO, since it says it wants a fine!", I am very much in support of the 
idea of keeping only the existing parameters, but making them accept both 
strings (which, for compatibility, would continue to be interpreted as 
filenames) and file-like objects as arguments. I think this would have a great 
deal of symmetry with how other parts of the Standard Library work, while 
keeping this patch's central value of making it possible for those of us with 
cert-heavy code to avoid the creation of thousands of files a minute.

Again, thank you VERY much for discovering that OpenSSL can do this, and I will 
try to provide whatever encouragement I can as you try to shepherd this past 
the other committers.

----------
nosy: +brandon-rhodes

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16487>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to