New submission from Daniel Kahn Gillmor <d...@fifthhorseman.net>:

The imaplib documentation says:


> Each command returns a tuple: (type, [data, ...]) where type is usually 
> 'OK' or 'NO', and data is either the text from the command response, or 
> mandated results from the command. Each data is either a string, or a
> tuple. If a tuple, then the first part is the header of the response, 
> and the second part contains the data (ie: ‘literal’ value).

However, "Each data is either a string, or a tuple" does not appear to be 
correct.   If the element of data is not a tuple, it appears to be a bytes 
object, not a string (because it is dealing with network streams of bytes 
internally)

This is probably old documentation left over from python 2, when strings and 
bytes were the same.

----------
components: email
messages: 360652
nosy: barry, dkg, r.david.murray
priority: normal
severity: normal
status: open
title: imaplib documentation claims that commands return a string, but they 
return bytes
type: behavior
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39447>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to