cpython
cpython copied to clipboard
bpo-13940: imaplib: All string arguments are now quoted when necessary.
Additionally, raise an error when given CRLF in arguments (this is invalid by the IMAP spec). Add tests for the above behaviour.
https://bugs.python.org/issue13940
Hello, and thanks for your contribution!
I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).
Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.
Thanks again to your contribution and we look forward to looking at it!
My email address didn't match up with the one I used for the CLA. I've now updated the commit to have the correct email.
Looks good, great help for imaplib
! Thank you. +1
Any chance this PR could get a review?
Any chance this PR could get a review?
I usually get best results when asking in the business hours on #python-dev
on Freenode. And of course, fixing that problem with NEWS would help as well. Everybody prefers to review PRs in green.
Any chance of getting some movement on this? The bug is a serious regression (2.x handles the quoting correctly) and it was reported over seven years ago. 🙁 We do want folks to migrate to Python 3, right? 😃
Also, I should point out that I believe the way the patch is currently implemented is a breaking change, beyond the bit about CRLF rejection. The documentation (before the patch is applied) says that the quoting will not be applied if the argument is already enclosed in double quotes, and that's how it was implemented in 2.7 when the quoting was actually done correctly. So anyone who has run into this bug in 3.x will have worked around it by enclosing (for example) folder names in double quotes. It's possible that I'm misreading the code in the patch (though that seems unlikely, given the corresponding change the patch applies to the documentation), but it seems that the patch will add a duplicate set of double quotes to an arg which is already quoted.
@bearbin, I think you need to make some changes to get this pull request in. The contested parts seem to be
- password should always be quoted
- quote only if not quoted already (Python 2.7 does so)
- can you do without the MapCRLF change?
This PR is stale because it has been open for 30 days with no activity.