[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan
ThePokestarFan added the comment: You're most likely right, so I'll close it. The lesson is most likely to not use weird arguments, but modules such as datetime warn against it, so I was surprised. -- ___ Python tracker

[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan
Change by ThePokestarFan : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mai

[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: It's not textwrap that's doing it, which is why the error is so unhelpful; the input is assumed to be a str, and the translate method is called on it with a dict argument, which is valid for str.translate, but not for bytes.translate. You'll get other "unhel

[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan
Change by ThePokestarFan : -- keywords: +patch pull_requests: +21537 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22534 ___ Python tracker ___ _

[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan
New submission from ThePokestarFan : The wrap() method of the TextWrapper class (and the module-level wrap method) throws an unhelpful TypeError upon getting a bytes object. -- components: Library (Lib) files: traceback.txt messages: 377910 nosy: ThePokestarFan priority: normal severit