<< Back to previous view

[DJSON-13] clojure.data.json/pprint output might be cut off Created: 01/Sep/13  Updated: 10/Jan/14  Resolved: 10/Jan/14

Status: Closed
Project: data.json
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Nelson Morris Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: File jsont.tgz    


From a question in irc[1].

When running a main from AOT'd class which uses clojure.data.json/pprint to print a large structure, the output may be cut off. It looks like clojure.data.json/pprint does not flush the stream when finished. For comparison, clojure.pprint/pprint adds a prn if it ends with a non endline.


Download attached jsont.tgz.
tar -jxf jsont.tgz
cd jsont.tgz
lein uberjar
java -jar target/jsont-0.1.0-SNAPSHOT-standalone.jar

Current output:

[0, 1, 2, 3, ... 9599, 96
(output cut off after 96)

Expected output:

[0, 1, 2, 3, ... 9999]

Workaround: adding (flush) after (clojure.data.json/pprint ...) calls.

[1] http://clojure-log.n01se.net/date/2013-09-01.html#20:15
[2] https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/pprint_base.clj#L252

Comment by Stuart Sierra [ 10/Jan/14 10:43 AM ]


Comment by Stuart Sierra [ 10/Jan/14 11:10 AM ]

Marking old issues as 'closed'

Generated at Thu Jan 18 22:02:47 CST 2018 using JIRA 4.4#649-r158309.