[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J
Lukas J added the comment: Ok thank you! -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J
Lukas J added the comment: Minimal example: import email.policy import email.mime.text responsehtml = "somehtmlbody" msg = email.mime.text.MIMEText(responsehtml, "html", policy=email.policy.EmailPolicy()) msg["to"] = "t...@example.com" msg["c

[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J
Lukas J added the comment: Indeed it is. Sorry I didn't find it before. So it seems that changing float("+inf") to sys.maxsize would solve the problem? I've tried it in an interactive shell: >>> a = "asd"; import

[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J
New submission from Lukas J : When converting an email.message.Message with the policy set to email.policy.EmailPolicy with all default settings, I eventually end up with this exception: File "/usr/lib/python3.7/email/_header_value_parser.py", line 2727, in _fold_as_ew