- custom python encoder for handling nan, infinity and -infinity, which are non-valid json values and can possibly screw your json parser1 read0 comments-1 read0 comments-You must read the article before you can comment on it.Be the first to post a comment on this article.