Closed amueller closed 5 years ago
I can reproduce with 0.14.0, Python 3.7.2, Fedora 29.
You don't need a complex object either, you just have to set the width to shorter than what is logically needed. prettyprinter.pprint('a', width=3)
works, but prettyprinter.pprint('a', width=2)
hangs. The original reproducer works if you set the width to at least 55.
Thanks for reporting this. Fixed in #33. Will craft a release soon.
The culprit was the string prettyprinter, which side-steps the normal layout algorithm using the Contextual
doc type to decide how it wants to split up a string to multiple lines based on remaining available width at that position. It didn't account for the case where a nested structure is deep enough to eat up all the available width and got stuck in an infinite loop.
The fix for this is released in v0.15.0
.
Description
doesn't terminate