This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients alex, christian.heimes, dstufft, janssen, njs, vstinner
Date 2019-06-17.21:29:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
New changeset 78c7d527799dacca91b9ed67057cb996efe526b0 by Christian Heimes in branch 'master':
bpo-37120: Add SSLContext.num_tickets (GH-13719)

This change introduced this warning on Windows:

c:\vstinner\python\master\modules\_ssl.c(3624): warning C4267: 'function': conv 
ersion from 'size_t' to 'long', possible loss of data [C:\vstinner\python\maste 

SSL_CTX_get_num_tickets() return type is size_t. I suggest this change:

diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 2331c58ad7..3ffb6380d3 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -3621,7 +3621,7 @@ set_maximum_version(PySSLContext *self, PyObject *arg, void *c)
 static PyObject *
 get_num_tickets(PySSLContext *self, void *c)
-    return PyLong_FromLong(SSL_CTX_get_num_tickets(self->ctx));
+    return PyLong_FromSize_t(SSL_CTX_get_num_tickets(self->ctx));
 static int
Date User Action Args
2019-06-17 21:29:28vstinnersetrecipients: + vstinner, janssen, christian.heimes, alex, njs, dstufft
2019-06-17 21:29:28vstinnersetmessageid: <>
2019-06-17 21:29:28vstinnerlinkissue37120 messages
2019-06-17 21:29:28vstinnercreate