Clojure

pprint doesn't flush the underlying stream

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.5
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Unlike prn, pprint doesn't flush the underlying stream.

pretty_writer currently overrides .flush with behaviour that pushes its own data, but does not flush the underlying stream.

pprint should behave similarly to prn with respect to flushing the underlying stream.

Activity

Hide
David Powell added a comment -

Test included.
Patch should ensure that flushing happens after pprint, without introducing any additional unnecessary flushes.

Show
David Powell added a comment - Test included. Patch should ensure that flushing happens after pprint, without introducing any additional unnecessary flushes.
Hide
Stuart Halloway added a comment -

I am confused by the tests – they all seem to call prn, though some claim to be calling pprint.

Show
Stuart Halloway added a comment - I am confused by the tests – they all seem to call prn, though some claim to be calling pprint.
Hide
David Powell added a comment -

Ah, sorry. I'd tried to remove duplicate tests before committing them, but removed the wrong ones.
Replacement patch attached:

0002-pprint-now-flushes-the-underlying-stream-similarly-t.patch

Show
David Powell added a comment - Ah, sorry. I'd tried to remove duplicate tests before committing them, but removed the wrong ones. Replacement patch attached: 0002-pprint-now-flushes-the-underlying-stream-similarly-t.patch
Hide
Andy Fingerhut added a comment -

Tempting fate once again by changing Approval from Incomplete to None after the reason it was marked as incomplete seems to have been addressed.

Show
Andy Fingerhut added a comment - Tempting fate once again by changing Approval from Incomplete to None after the reason it was marked as incomplete seems to have been addressed.
Hide
Stuart Sierra added a comment -

Screened.

Show
Stuart Sierra added a comment - Screened.
Hide
Stuart Sierra added a comment -

Pushed in commit 1588ff3f70e864d9817bc565bd2c30b08189bc6e

Show
Stuart Sierra added a comment - Pushed in commit 1588ff3f70e864d9817bc565bd2c30b08189bc6e

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: