ensure_str needed see cyruslib handling
else string is compared with bytes and the imapfolder won't be verified
tested with dm DELETED* on buster with python 2.7 and 3.x
In the original code, double quotes are added around the string; your change removes these quotes. Is there a particular reason for this?
[LIST "" ""b'DELETED/shared/group/Calendar/Personal Calendaremail@example.com'""] BAD: bUnexpected extra arguments to List
See doubled Quotes, which causes this Error