I would suggest to create new thread for this so this new issue will get noticed by the experts.
Back to your issue, as per this thread it happens when your script returning big size data. The size could vary as per system config but this is the most probable reason.
Other option you have is, if you could working folder
of python scope to store the output in some file and read it back wherever required in your code again.
Thanks,
Ashok