Hello, I can reproduce this bug on jessie.
The problem apparently come from the function bio_gets in _bio.i (M2crypto).
In this function it is only checked if BIO_gets (Openssl) is less than 0.
But BIO_gets
can retrun either  0 or -1 to indicate end-of-stream.

Thus we have two way to fix the probem:
Either patch bio_gets in M2crypto or test in BIO.py if len(buf)==0.

Hope it helps,
Regards,

Anthony.
--- /usr/lib64/python2.7/site-packages/M2Crypto/BIO.py	2011-01-15 20:10:05.000000000 +0100
+++ BIO.py	2015-05-20 09:24:46.600582999 +0200
@@ -73,6 +73,8 @@
             buf=m2.bio_gets(self.bio, 4096)
             if buf is None:
                 break
+	    if len(buf)==0:
+		break
             lines.append(buf)
         return lines
 

Reply via email to