[issue19770] NNTP.post broken

2019-04-10 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19770] NNTP.post broken

2019-04-10 Thread R. David Murray
R. David Murray added the comment: I do, and sure. I won't be able to review it, though :( -- ___ Python tracker ___ ___

[issue19770] NNTP.post broken

2019-04-10 Thread Cheryl Sabella
Cheryl Sabella added the comment: Hi David, You wrote: > It might be worth adding a post_message method, analogous to the send_message > method I added to smtplib. Do you still think this would be worthwhile to add? If so, do you think this would be a good task for someone to work on at

[issue19770] NNTP.post broken

2013-11-25 Thread Szymon Sobik
New submission from Szymon Sobik: post method fails because string methods have bytesrting arguments ie. line = line.rstrip(b\r\n) + _CRLF -- components: Library (Lib) messages: 204331 nosy: sobczyk priority: normal severity: normal status: open title: NNTP.post broken type: behavior

[issue19770] NNTP.post broken

2013-11-25 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19770 ___ ___ Python-bugs-list

[issue19770] NNTP.post broken

2013-11-25 Thread R. David Murray
R. David Murray added the comment: Can you show an example of the failure, including the traceback? I would think that nttplib would be mostly operating on byte objects, and I'm sure Antoine tested posting. -- nosy: +pitrou, r.david.murray ___

[issue19770] NNTP.post broken

2013-11-25 Thread Szymon Sobik
Szymon Sobik added the comment: Traceback (most recent call last): File ./nntp_test.py, line 23, in module s.post(msg) File /usr/lib/python3.3/nntplib.py, line 909, in post return self._post('POST', data) File /usr/lib/python3.3/nntplib.py, line 895, in _post if not

[issue19770] NNTP.post broken

2013-11-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: This won't work. The post() method needs a bytes object, or something which when iterating yields bytes data. Perhaps you can try to call as_bytes() on your MIMEText object: http://docs.python.org/dev/library/email.message.html#email.message.Message.as_bytes

[issue19770] NNTP.post broken

2013-11-25 Thread R. David Murray
R. David Murray added the comment: as_bytes was added in 3.4. For earlier python versions, you'll have to create a BytesGenerator object and flatten the message using it to get a bytes object you can past to post. -- ___ Python tracker

[issue19770] NNTP.post broken

2013-11-25 Thread R. David Murray
R. David Murray added the comment: It might be worth adding a post_message method, analogous to the send_message method I added to smtplib. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19770

[issue19770] NNTP.post broken

2013-11-25 Thread Szymon Sobik
Szymon Sobik added the comment: Ok I found this out too on my own. It might be better to add examples using the MIME* classes to nntplib documentation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19770