(value, fmt=FMT_XML, skipkeys=False, sort_keys=True)
| 227 | raise ValueError("Unsupported format: {}".format(fmt)) |
| 228 | |
| 229 | def dumps(value, fmt=FMT_XML, skipkeys=False, sort_keys=True): |
| 230 | # We avoid using writePlistToString() as that uses |
| 231 | # cStringIO and fails when Unicode strings are detected |
| 232 | f = BytesIO() if _check_py3() else StringIO() |
| 233 | dump(value, f, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys) |
| 234 | value = f.getvalue() |
| 235 | if _check_py3(): |
| 236 | value = value.decode("utf-8") |
| 237 | return value |
| 238 | |
| 239 | ### ### |
| 240 | # Binary Plist Stuff For Py2 # |
nothing calls this directly
no test coverage detected