This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients andrei.avk, barry, mglover, r.david.murray
Date 2021-07-06.17:16:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625591818.72.0.493352381671.issue43493@roundup.psfhosted.org>
In-reply-to
Content
Ah, yes, the problem is more subtle than I thought.

The design here is that we should be starting with the largest lexical unit, seeing if that fits on the current line, or a line by itself, and if so, using that, and if not, move down to the next smaller lexical unit and try again, until we are finally left with an unbreakable unit.  For unstructured headers such as Subject the lexical units should be encoded words followed by blank delimited words.  I'm guessing the code is treating the collection of words it has accumulated as a unit in the above algorithm, and since it fits on a line by itself, it goes with that.  So yeah, it's sort of intentional.

So the bug here is that in your step 2 we ideally want to be considering whether the last token on the current line is at the same lexical level as the token that precedes it...and if so, and if moving that token to the next line lets the remainder fit on the first line, we should do that.  Exactly how to implement that correctly is a good question...it's been too long since I wrote that code, and I may not have time to investigate it more deeply.

If you come up with something based on my description of the intent above, I should be able to review it (though you might need to ping me directly to get my attention).
History
Date User Action Args
2021-07-06 17:16:58r.david.murraysetrecipients: + r.david.murray, barry, andrei.avk, mglover
2021-07-06 17:16:58r.david.murraysetmessageid: <1625591818.72.0.493352381671.issue43493@roundup.psfhosted.org>
2021-07-06 17:16:58r.david.murraylinkissue43493 messages
2021-07-06 17:16:58r.david.murraycreate