fix crash in Python object to C++ string conversion

--HG--
extra : amend_source : 6a5e7668208a89296264b05bbfe7640514318a1d