Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: fixes python3.10 build of python module - changes to string length in arg parsing #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/fastrpcmodule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*/

#define __ENABLE_WSTRING
// defined here to indicate # args to PyArgs_ParseTuple use Py_ssize_t instead of int
#define PY_SSIZE_T_CLEAN

// Included first to get rid of the _POSIX_C_SOURCE warning
#include <Python.h>
Expand Down Expand Up @@ -1682,7 +1684,7 @@ PyObject* ServerProxy_ServerProxy(ServerProxyObject *, PyObject *args,

// parse arguments
PyStrDataType_t serverUrl;
int serverUrlLen;
Py_ssize_t serverUrlLen;
int readTimeout = -1;
int writeTimeout = -1;
int connectTimeout = -1;
Expand Down Expand Up @@ -1734,7 +1736,7 @@ PyObject* ServerProxy_ServerProxy(ServerProxyObject *, PyObject *args,
// Initialization from ConfigParser and section
PyObject *cfgParser;
char *cfgSection;
int cfgSectionLen;
Py_ssize_t cfgSectionLen;

if (!PyArg_ParseTuple(args, "Os#:ServerProxy.__init__",
&cfgParser, &cfgSection, &cfgSectionLen)) {
Expand Down