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 bmwiedemann
Recipients bmwiedemann, brett.cannon, ezio.melotti, mrabarnett, pitrou
Date 2015-12-15.15:54:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450194897.19.0.781302598821.issue25870@psf.upfronthosting.co.za>
In-reply-to
Content
Many python scripts use textwrap to break base64-encoded strings from openssl into lines - e.g. https://bugs.launchpad.net/python-keystoneclient/+bug/1404402
and https://github.com/diafygi/acme-tiny/blob/master/acme_tiny.py#L166

Steps To Reproduce:
time python -c "import textwrap; textwrap.wrap('x'*9000, 64)"

This has a complexity of O(n^2), meaning wrapping 18000 chars takes 4 times as long as 9000.

one known workaround is to use
textwrap.wrap('x'*9000, 64, break_on_hyphens=False)

this also has O(n^2) complexity, but is around 2000 times faster.
History
Date User Action Args
2015-12-15 15:54:57bmwiedemannsetrecipients: + bmwiedemann, brett.cannon, pitrou, ezio.melotti, mrabarnett
2015-12-15 15:54:57bmwiedemannsetmessageid: <1450194897.19.0.781302598821.issue25870@psf.upfronthosting.co.za>
2015-12-15 15:54:57bmwiedemannlinkissue25870 messages
2015-12-15 15:54:56bmwiedemanncreate