On 2016-07-25, 09:55 GMT, Craig Rodrigues wrote:
First of all, thank you very much for all help you gave to M2Crypto. However, ...

I call shenanigans on you.

Nothing of which I have been accused of has anything to do with what I meant. When I said „opaque“, I didn’t mean to offend Twisted. Just to say, that while I was marking whole library with PEP-484 type hints, I usually dealt with bytes, str, ints, and very few rather simple objects. With Twisted I get object

   @implementer(ITLSTransport)
   class TLSProtocolWrapper(ProtocolWrapper):
def __init__(self, factory, wrappedProtocol, startPassThrough, client,
                    contextFactory, postConnectionCheck):
           # type: policies.WrappingFactory, object, int, int, object, Checker

(and with those two objects, I don't even dare to guess what types these are, and all that covered in some weird decorator from Zope (?)).

That's nothing wrong with Twisted, just that it is really difficult for idiot like me to understand what's going on.

If you are unfamiliar with Twisted's code and data types, and don't have the energy to dig in, then be honest about that, but don't accuse Twisted of being "opaque", because it isn't.

I don't think what's dishonest on saying that Twisted API is quite complicated and I am stupid enough not understanding what's going on.

Regarding your code example which is failing,
your code is failing because you are intermixing bytes and strings which is
a big no-no for Python 3.

Of course I know that (it is not the first place where I have to deal with bytes × str dichotomy in py3k), but in order to understand what's going, I have to first understand where these values come from and where they run to, i.e., to decipher Twisted. Thus I was asking for help.

If I look at this line for example:
https://gitlab.com/m2crypto/m2crypto/blob/master/M2Crypto/SSL/TwistedProtocolWrapper.py#L357

I see the code is doing stuff like:
   data = ''
   encryptedData = ''

Those are of type str, and need to be of type bytes:

   data = b''
   encryptedData = b''

You need to clean stuff like that up in your code so that you are only
using bytes.

I believe I have fixed all I can do without actually understanding Twisted in https://gitlab.com/mcepl/m2crypto/commit/6cd5f87b31e50016ebb7e44f3f2ae46610bc24e0. So now, if Twisted is so transparent and perfectly understandable, could you please suggest, what I do wrong, that the test ends in the endless loop (https://travis-ci.org/mcepl/M2Crypto/builds/147175901)?

Thank you,

Matěj Cepl

--
https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8

Never ascribe to malice that which is adequately explained by
stupidity.
   -- Napoleon Bonaparte (or many other people to whom this
      quote is ascribed)

Attachment: pgpkgiJOMX1e9.pgp
Description: PGP signature

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to