Bug#588348: offlineimap: Looses mails if PYTHONOPTIMIZE is set
Justification: causes serious data loss
offlineimap calls critical code paths only via assert.
If PYTHONOPTIMIZE is set, python will - besides other optimisations - ignore all assert statements.
In combination, this caused my entire "sent" folder to get lost as I tried to sync it with a courier-imap server (on which the folder had just been created).
I had reported a similar issue in 2008 (Bug #80: improper use of assert statement), though at that time it just duplicated mails instead of loosing them.
(Python) upstream considers assert a mere debugging tool. See e.g. "Language Reference" section 6.3, first paragraph:
> Assert statements are a convenient way to insert debugging assertions into a program:
The same section also explains that enabling optimization will cause assert statements not to be evaluated.
Thus this is definitely a bug in offlineimap. assert should not be used to invoke regular code paths.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 18.104.22.168-xo1.5-2-00377-g7f5e423 (PREEMPT)
Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages offlineimap depends on:
ii python 2.6.5-5 An interactive high-level object-o
ii python-support 1.0.8 automated rebuilding support for P
offlineimap recommends no packages.
Versions of packages offlineimap suggests:
pn python-kerberos <none> (no description available)
-- no debconf information