mirror of
https://github.com/corpnewt/gibMacOS.git
synced 2024-12-04 13:33:26 +01:00
Bypass cStringIO for writes too
This commit is contained in:
parent
7072baa61e
commit
2e12e6f530
@ -93,7 +93,12 @@ def dumps(value, fmt=FMT_XML, skipkeys=False):
|
||||
if _check_py3():
|
||||
return plistlib.dumps(value, fmt=fmt, skipkeys=skipkeys).decode("utf-8")
|
||||
else:
|
||||
return plistlib.writePlistToString(value)
|
||||
# We avoid using writePlistToString() as that uses
|
||||
# cStringIO and fails when Unicode strings are detected
|
||||
# return plistlib.writePlistToString(value)
|
||||
f = StringIO()
|
||||
plistlib.writePlist(value, f)
|
||||
return f.getvalue()
|
||||
|
||||
### ###
|
||||
# Binary Plist Stuff For Py2 #
|
||||
|
Loading…
Reference in New Issue
Block a user