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