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

2019-02-13 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- superseder: -> non-ascii characters in headers causes TypeError on email.policy.Policy.fold ___ Python tracker ___ ___

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

2019-02-13 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Just add the link to the other issue: https://bugs.python.org/issue33524 -- ___ Python tracker ___ __

[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 ___ ___

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

2019-02-13 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the confirmation. I would propose closing this as a duplicate. The PR on the other issue might fix your issue and is just waiting on a NEWS entry. -- ___ Python tracker

[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["cc"] = "äöü " msg["From"] = "f...@bar.com" msg["S

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

2019-02-13 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Could you share your example? Thank you -- nosy: +matrixise ___ Python tracker ___ ___ Python-bu

[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 sys >>> a[:sys.maxsize] 'asd' --

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

2019-02-13 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This seems to be same as issue33524 ? -- nosy: +xtreak ___ Python tracker ___ ___ Pytho

[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 first_part = t