[GIT PULL] Make offlineimap works with Python3

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon May 9 23:52:10 BST 2016


On Mon, May 09, 2016 at 07:45:22PM +0200, Łukasz Żarnowiecki wrote:

> Hello again,
> 
> Please review this change set which adds support for Python3 and
> hopefully does not break Python2 compatibility.  It works for me, but it
> might not work for every one.

imaplib2 is comatible with Python 2 only. Piers released another file to
support Python 3. We will have to import this other file and find a name
for it. Someone else took the "imaplib3" namespace for something else.
So, you might want something like "imaplib23.py".

Since string changed with python 3, I'm expecting returned data types
from imaplib2 (py3) to change, too.  This might introduce subtle bugs.

>                                I am expecting bugs and I am willing to
> fix them.
>
> We might push this changes to next or to a new branch or even release
> some alpha so people could test it and report any issues.

Please, send the patches here by email like before. It's much easier to
comment on.

I didn't even try to migrate offlineimap to Python 3 because supporting
UTF-8 everywhere was hard. Perhaps working the other way around (support
Python 3 first) might do it.

I'm not a fan of long term branches outside of the mainline. They tend
to become hard to merge later. Also, rebasing to follow the mainline is
not a pleasure. OTOH, merging to 'next' is not ideal because of possible
new subtle bugs... I'll think about that but I think I'll merge the less
dangerous patches into 'next' and discuss what to do with the others
here.

> The following changes since commit 6b8ee4a183fc50eb1bcc7b31a9fc09e9cc705163:
> 
>   Handle maxage for davmail correctly (2016-05-07 13:29:44 +0200)
> 
> are available in the git repository at:
> 
>   https://github.com/dolohow/offlineimap.git python3
> 
> for you to fetch changes up to 0861d9797562694b3fa501b76f88447b60e4ccd3:
> 
>   Wrap zip calls with list call (2016-05-09 19:24:17 +0200)
> 
> ----------------------------------------------------------------
> Łukasz Żarnowiecki (15):
>       Raise exceptions as defined in PEP 3109
>       Convert except X,T to except X as T
>       Do not mix tabs with spaces
>       Rename email.Parser to email.parser
>       Convert basestring to str
>       Add workaround for string.split for Python3
>       Encode utf-8 argument for md5 function
>       Replace calls to long with int calls
>       Replace dictionary iteration methods
>       Change filter with lambda to list comprehension
>       Do not encode elements of list
>       Replace has_key method to "key in dict"
>       Replace xrange with range
>       Remove xreadlines calls
>       Wrap zip calls with list call
> 
>  offlineimap/CustomConfig.py             |  4 ++--
>  offlineimap/accounts.py                 | 10 ++++------
>  offlineimap/emailutil.py                |  2 +-
>  offlineimap/folder/Base.py              | 27 ++++++++++++-------------
>  offlineimap/folder/Gmail.py             | 10 +++++-----
>  offlineimap/folder/GmailMaildir.py      | 26 ++++++++++++------------
>  offlineimap/folder/IMAP.py              | 21 ++++++++++----------
>  offlineimap/folder/LocalStatus.py       | 20 +++++++++----------
>  offlineimap/folder/LocalStatusSQLite.py | 16 +++++++--------
>  offlineimap/folder/Maildir.py           | 35 ++++++++++++++++-----------------
>  offlineimap/folder/UIDMaps.py           | 18 ++++++++---------
>  offlineimap/imaplib2.py                 |  4 ++--

imaplib2 is maintained upstream and we don't diverge from it.

>  offlineimap/imaplibutil.py              |  8 ++++----
>  offlineimap/imapserver.py               | 11 +++++------
>  offlineimap/imaputil.py                 | 10 ++++++++--
>  offlineimap/init.py                     | 12 +++++------
>  offlineimap/mbnames.py                  |  2 +-
>  offlineimap/repository/Base.py          |  8 ++++----
>  offlineimap/repository/IMAP.py          |  7 ++++---
>  offlineimap/repository/LocalStatus.py   |  4 ++--
>  offlineimap/repository/__init__.py      | 10 ++++++----
>  offlineimap/utils/stacktrace.py         |  2 +-
>  test/OLItest/TestRunner.py              |  4 +---
>  test/tests/test_00_globals.py           |  2 +-
>  24 files changed, 137 insertions(+), 136 deletions(-)

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list