(cherry picked from commit dcbf59d8a7)
dcbf59d8a7
Python: several fixes (cherry picked from commit 67651d80bc)
67651d80bc