Author shashank
Recipients pitrou, r.david.murray, shashank
Date 2010-10-23.21:22:06
SpamBayes Score 2.84772e-14
Marked as misclassified No
Message-id <>
>the C module should be private and therefore called _zipdecrypt

>if you want to avoid API mismatch, you could give a tp_call to your C >decrypter object, rather than a "decrypt" method

>- you can put all initialization code in zipdecrypt_new and avoid the >need for zipdecrypt_init
keeping this similar to the existing _ZipDecrypter class in ZipFile (all initialization in init rather than new), which was probably to allow re-init and re-use of one instance

>it's better to use the "y*" code in PyArg_ParseTuple, rather than "s#"
y* does not seem to be available in 2.7, using s* instead

>you should define your module as PY_SSIZE_T_CLEAN and use Py_ssize_t >as length variables (rather than int)

>you *mustn't* change the contents of the buffer which is given you by >"s#" or "y*", since that buffer is read-only (it can be a bytes >object); instead, create a new bytes object using >PyBytes_FromStringAndSize(NULL, length) and write into that; or, if >you want a read-write buffer, use the "w*" code
corrected, not altering the input buffer, reading input buffer as s*
Date User Action Args
2010-10-23 21:22:11shashanksetrecipients: + shashank, pitrou, r.david.murray
2010-10-23 21:22:11shashanksetmessageid: <>
2010-10-23 21:22:10shashanklinkissue10030 messages
2010-10-23 21:22:10shashankcreate