# \[Bug\] system.util.sendMessage fails with remoteServers when payload is not a dict

**URL:** <https://forum.inductiveautomation.com/t/bug-system-util-sendmessage-fails-with-remoteservers-when-payload-is-not-a-dict/55040>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 14, 2022, 6:57pm UTC](https://forum.inductiveautomation.com/t/bug-system-util-sendmessage-fails-with-remoteservers-when-payload-is-not-a-dict/55040 "2022-01-14T18:57:23Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![alan.s.kinnaman](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@alan.s.kinnaman](https://forum.inductiveautomation.com/u/alan.s.kinnaman)\
**Post date:** [October 7, 2022, 7:13pm UTC](https://forum.inductiveautomation.com/t/bug-system-util-sendmessage-fails-with-remoteservers-when-payload-is-not-a-dict/55040/7 "2022-10-07T19:13:55Z")

</div>

We have the code below in a script module that converts Ignition-specific objects to native Python lists and dicts. We pass the Ignition object to the `propertyToPython` function, and get back Python lists and/or dicts.

```auto
def _isDictLikeObject(value):
	return 'iteritems' in dir(value)

def _isListLikeObject(value):
	return 'append' in dir(value)
	    	
	
def dictLikeObjectToDict(dictLikeObject):
	pyDict = {}
	for key, item in dict(dictLikeObject).iteritems():
		item = propertyToPython(item)				
		pyDict[key] = item
	return pyDict

def listLikeObjectToList(listLikeObject):
	pyList = []
	for item in list(listLikeObject):
		item = propertyToPython(item)				
		pyList.append(item)
	return pyList

def propertyToPython(property):
	"""
	Accepts a value, object, or array property that might be
	encoded as an Ignition ObjectWrapper or ArrayWrapper and
	returns the property as Python dicts and lists.
	"""
	if _isDictLikeObject(property):
		property = dictLikeObjectToDict(property)
	elif _isListLikeObject(property):
		property = listLikeObjectToList(property)
	return property

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/bug-system-util-sendmessage-fails-with-remoteservers-when-payload-is-not-a-dict/55040)._
