-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
After loading in a properties file, if I use __setitem__ to set a value to a non-string (e.g. prop['http.port'] = 7180), I get an attribute error upon trying to serialize my Properties instance with str(). That is,
str(props)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/jproperties.py", line 58, in __str__
ret.append(self.escape_key(node.key) + node.separator + self.escape(node.value))
File "/usr/lib/python3.5/site-packages/jproperties.py", line 81, in escape
return value.encode("unicode_escape").decode("utf-8")
AttributeError: 'int' object has no attribute 'encode'
Perhaps a forced cast should be introduced somewhere in the escape chain?
Metadata
Metadata
Assignees
Labels
No labels