Bugfix in write_python_list