clojure.data.json/pprint output might be cut off

Description

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.

Reproduction:

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

Environment

None

Attachments

1
  • 02 Sep 2013, 02:32 AM

Activity

Show:

Stuart SierraJanuary 10, 2014 at 5:10 PM

Marking old issues as 'closed'

Completed

Details

Assignee

Reporter

Priority

Created September 2, 2013 at 2:32 AM
Updated January 10, 2014 at 5:10 PM
Resolved January 10, 2014 at 5:10 PM