Message126532
| Author |
lavajoe |
| Recipients |
lavajoe |
| Date |
2011年01月19日.15:35:30 |
| SpamBayes Score |
1.0146782e-06 |
| Marked as misclassified |
No |
| Message-id |
<1295451332.43.0.977417439806.issue10947@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In imaplib, there is currently a mix of bytes array and str use. Time2Internaldate(), e.g., returns (and accepts) str. Internaldate2tuple() and ParseFlags() only accept a bytes object, and the latter returns a tuple of bytes objects. Of course, these were all strings in Python 2.
To regain compatibility with Python 2 behavior and make things more consistent, this patch changes the return type of ParseFlags() to a str tuple, and allow it and Internaldate2tuple() to accept either a bytes object or a str.
The unit test has been expanded to test these. Note that applying this patch assumes that the the patches from issue 10939 and issue 10941 have been applied.
Also, I am not sure it is proper to accept *both* bytes array and str. Perhaps only str should be allowed. Comments? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年01月19日 15:35:32 | lavajoe | set | recipients:
+ lavajoe |
| 2011年01月19日 15:35:32 | lavajoe | set | messageid: <1295451332.43.0.977417439806.issue10947@psf.upfronthosting.co.za> |
| 2011年01月19日 15:35:30 | lavajoe | link | issue10947 messages |
| 2011年01月19日 15:35:30 | lavajoe | create |
|