-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use remotepasseval with Python3 #373
Comments
Setting the pythonfile to be:
does not work since offlineimap expects it to be a byte object, not a string. But Python3 byte objects do not have an |
I had the same issue and found the following fixes it. However, using python3, offlineimap tries to authenticate using method=PLAIN first, which fails. Server log: python3: python2: No idea why that happens, but after an initial offlineimap works nicely with python2 and python3. Hope that helps, Cheers, |
@BeerSerc Could send your signoff so I can merge? The chunks on imaplib2 must be sent to the imaplib2 project. |
As I said, it still triggers the behaviour that OI now tries this PLAIN auth to the server, so I think it might be good if somebody else could have a look at it. Not a python3 expert myself ... And as I'm new to github, how would I sign off an attached patch like this? Or do I need to fork and send a pull request? Or do you just want a signed-off line with an email address? |
When doing
@nicolas33 accepts both, but the commits or email patches need to be signed off. |
I'll remove the chunk about UTF-8 encoding, too. This is the wrong place to do this. In IMAP.py the value of IMAPRepository.getuser() must be UTF-8 encoded, already.. |
This is all about python2 str vs python3 bytes. So if you remove the encode/decode stuff, we are back to zero where offlineimap does not work with python3 if you use remotepasseval. |
I was talking the encode call in your patch. It's wrong to have two chained UTF-8 encode calls. With the patch they are for some case. If fixing one use case breaks other use cases, the patch is wrong. |
Sorry for the delay. What I wanted to say is: My patch is nothing but encodes and decodes, because for some reason in 7.0.6/HEAD this is in some places mixed, what results in the problems the original reporter (and me) had. |
@BeerSerc Got it! Thanks! |
I traced it down a little further. I am pretty convinced that the problem is the _quote() function in bundled_imaplib2.py +1648. it reads def _quote(self, arg): which fails if arg is your password as a byte string. ERROR: All authentication types failed: |
This bug should be closed. If you are running Python3, then use offlineimap3. Regards, |
General informations
offlineimap -V
): offlineimap v7.0.5, imaplib2 v2.55 (bundled)Configuration file offlineimaprc
pythonfile (if any)
Logs, error
Steps to reproduce the error
The text was updated successfully, but these errors were encountered: