OpenStack library for serialization
Go to file
Victor Stinner 01177314a1 jsonutils.to_primitive(): add fallback parameter
For example, to_primitive(fallback=repr) can be used to prevent
serialialization error like "ValueError: Circular reference detected"
when using the JSONFormatter of oslo.log.

If fallback is set, it is also used to convert itertools.count(),
"nasty" objects like types, and to handle TypeError.

Use fallback=six.text_type to convert objects to text.

This patch doesn't change the default behaviour.

Related-Bug: #1593641
Change-Id: Ie0f7f2d09355c3d2a9f7c5ee8f7e02dfea3b073b
(cherry picked from commit cdb2f60d26)
2017-12-15 17:39:51 +01:00
doc/source rearrange existing documentation to fit the new standard layout 2017-07-06 21:53:30 +00:00
oslo_serialization jsonutils.to_primitive(): add fallback parameter 2017-12-15 17:39:51 +01:00
releasenotes switch from oslosphinx to openstackdocstheme 2017-07-06 21:53:27 +00:00
tools Add Constraints support 2016-12-20 14:36:50 +11:00
.coveragerc Fix coverage configuration and execution 2015-10-08 17:22:20 -04:00
.gitignore Add reno for release notes management 2016-11-03 20:44:36 +08:00
.gitreview Update .gitreview for stable/pike 2017-07-28 21:05:28 +00:00
.mailmap exported from oslo-incubator by graduate.sh 2014-07-14 17:54:12 +00:00
.testr.conf Fixes wrong folder for listing tests 2015-04-27 15:00:14 +02:00
CONTRIBUTING.rst switch from oslosphinx to openstackdocstheme 2017-07-06 21:53:27 +00:00
HACKING.rst Update URLs in documents according to document migration 2017-07-12 23:21:07 +08:00
LICENSE exported from oslo-incubator by graduate.sh 2014-07-14 17:54:12 +00:00
README.rst Update URLs in documents according to document migration 2017-07-12 23:21:07 +08:00
babel.cfg exported from oslo-incubator by graduate.sh 2014-07-14 17:54:12 +00:00
requirements.txt Updated from global requirements 2017-04-12 04:20:20 +00:00
setup.cfg Use Sphinx 1.5 warning-is-error 2017-03-16 15:01:15 +00:00
setup.py Updated from global requirements 2017-03-03 00:03:20 +00:00
test-requirements.txt Updated from global requirements 2017-08-11 19:04:21 +00:00
tox.ini Update UPPER_CONSTRAINTS_FILE for stable/pike 2017-07-28 21:05:29 +00:00

README.rst

Team and repository tags

image

oslo.serialization

Latest Version

Downloads

The oslo.serialization library provides support for representing objects in transmittable and storable formats, such as Base64, JSON and MessagePack.