Conversation
| #include "interfaces/python/AddonPythonInvoker.h" | ||
| #include "interfaces/python/PythonInvoker.h" | ||
|
|
||
| PyThreadState* savestate; |
There was a problem hiding this comment.
shouldn't this be a meber of CPythonInvoker, XBPython or something similar
There was a problem hiding this comment.
Yeah, it was a temporary measure until a replacement to transfer the value of threadstate from XBPython to Pythoninvoker since paxxi said it wouldn't be a good idea to use global variables.
@Rechi
There was a problem hiding this comment.
Since the functions savestate is used in don't share a common class (neither heirarchial), the option other than gloabl variable would be to define the variable static in CPythonInvoker
c52da26 to
3bfd92d
Compare
| return NULL; | ||
| struct module_state *st = GETSTATE(module); | ||
|
|
||
| st->error = PyErr_NewException((char *)"${module.@name}.Error", NULL, NULL); |
There was a problem hiding this comment.
this needs to be removed, I only suggested it for testing but it doesn't do what I thought
4a2d9fb to
3f9df23
Compare
| else // If pobject is of type Bytes | ||
| { | ||
| buf = PyString_AsString(pObject); | ||
| buf = PyUnicode_AsUTF8(pObject); |
There was a problem hiding this comment.
I get crashes with a nullptr exception here
| if (utf8_pyString) | ||
| { | ||
| buf = PyString_AsString(utf8_pyString); | ||
| buf = PyUnicode_AsUTF8(utf8_pyString); |
There was a problem hiding this comment.
I get crashes with a nullptr exception here
| Py_DECREF(utf8_pyString); | ||
| return; | ||
| } | ||
| buf = PyUnicode_AsUTF8(pObject); |
There was a problem hiding this comment.
@Rechi Can you check if this works correctly?
According to the documentation, this function should encode the PyObject as UTF-8 and return the pointer to the string so wouldn't need another function to encode.
There was a problem hiding this comment.
have tested that already during getting the crash and it worked
eca0976 to
0d2d6ef
Compare
ea87963 to
31aba04
Compare
| pythonmodule-pycryptodome: python36 pythonmodule-setuptools | ||
| pythonmodule-pil: $(ZLIB) libjpeg-turbo libpng freetype2 python36 pythonmodule-setuptools | ||
| pythonmodule-setuptools: python36 | ||
| >>>>>>> Changed Tools/Depends MakeFiles |
|
|
||
| .installed-$(PLATFORM): $(LIBDYLIB) | ||
| cd $(PLATFORM); $(MAKE) install | ||
| cd $(PLATFORM); $(MAKE) regen-grammar |
There was a problem hiding this comment.
this is a build command, not an install command
1b2fb4e to
f340592
Compare
1137526 to
8e23580
Compare
* Updated all the files from old function names to new function names as given in pydocs - http://py3c.readthedocs.io/en/latest/reference.html * changed char to wchar_t * File pointer (FILE *) updated * Updated ob_type to be called by multi layered PyObject * Removed tp_compare since it's depreciated * Updated definitions for InitModule * Updated the Python3 Android Script * Updated the GIL acquisition and release statements * Updated module initialization from init<module> to PyInit_<module> and added the new modules to built-in library through PyImport_AppendInitTab * Charset Conversion From char To wchar_t * Updated Python WSGI Invoker
In Python 3.7 Py_Initialize() now acuires the GIL that leads to a deadlock with the subsequent PyEval_AcquireLock() call. This should fix xbmc#14885.
Kodi code ported to Python3 with system dependencies updated accordingly
Description
The following changes have been made to the code -
Motivation and Context
It helps the add-on developers to code in Python3
How Has This Been Tested?
Yes, this has been tested on Jenkins and on Windows, Linux, and Android using add-ons ported to Python3
Types of change
Checklist: