OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 361 forks source link

Complain if offlineimap runs under python3 #714

Closed spaetz closed 2 years ago

spaetz commented 2 years ago

I installed offlineimap via (pip install offlineimap), ran it, and it bombed out with various mysterious (to me at least) tracebacks, which left me believing that offlineimap was in a desolate state.

It took quite some time to realize that I only have python3 on my system, and I should have been using offlineimap3. There was no complaint by offlineimap when I started it under python3. It would be awsome if offlineimap would output: "Offlineimap only runs under python2, please use offlineimap3 in order to run under python3" and quit orderly.

General informations

Sundin-13 commented 2 years ago

Yeah, I agree with you. Excuse me for being angry, but I AM ANGRY - offlineimap stopped working on MacOS, because Python 2 was removed - and Python 2 has been depreciated for AT LEAST FIVE YEARS by now. COME ON!

I did try offlineimap3 but it doesn't work on MacOS with HomeBrew. W T Holy F?

On a more serious note, I can help porting this to Python 3 with support for HomeBrew on MacOS. How hard can it be, right?

spaetz commented 2 years ago

☮ :-). offlineimap3 has been existing for quite a while and it is actively being developed, so no need to shout. It is not like anybody has ignored it for these years. The question is whether the default offlineimap should remain python2, or whether offlineimap3 should not be merged into offlineimap. The current offlineimap could be renamed offlineimap2, or offlineimap_legacy. Or if things remain as they are (which is fine too), offlineimap should warn the user when run under python2. Indeed, I might prepare a MR that does exactly that.

As for the homebrew problems you have, that sounds like a separate issue that you should file.

topherbuckley commented 2 years ago

I believe I am running into something related to this. If I run offlineimap from the terminal, how can I verify which python binary it is using? Is this configurable somewhere?

spaetz commented 2 years ago

offlineimap will always only run with python 2 due to #!/usr/bin/env python2. It can be invoked with any python explicitly though.

spaetz commented 2 years ago

Having said this, my simple merge request is ready and awaits merging by someone. It really just is a 2-3 liner.

topherbuckley commented 2 years ago

@spaetz thanks for the info. I was having some missing library errors so needed to make sure which binary it was using. So one must have an environment variable python2 which points to your binary of choice. Is that correct?

spaetz commented 2 years ago

no, #!/usr/bin/env python2 will search your $PATH variable and use the first binary "python2" to execute the script. it is the shebang automagic that the shell uses to determine with which binary a script is being executed.

nicolas33 commented 2 years ago

It took quite some time to realize that I only have python3 on my system, and I should have been using offlineimap3.

We should have done this earlier for sure. I'll make a new release with this in the coming weeks.

Thank you all.

BTW, you should all consider moving to offlineimap3 for python3. As said, this legacy projet has almost died.