OfflineIMAP / offlineimap

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

remotepasseval broken with recent upgrade? 'a bytes-like object is required, not 'str'' #697

Closed nllz closed 3 years ago

nllz commented 3 years ago

A recent upgrade to Ubuntu 21.04 from 20.04 seems to have broken my offineimap with GPG setup. Have tried trawling through old issues but could not determine the fix. All help appreciated.

PS Most likely a Python versioning thing, something which I run into a lot lately...

General informations

Configuration file offlineimaprc

# Path to file with arbitrary Python code to be loaded
pythonfile = ~/.offlineimap.py
# Decrypt and read the encrypted password
remotepasseval = get_passnielsddg()

pythonfile (if any)

#! /usr/bin/env python3
from subprocess import check_output

def get_passnielsddg():
    return check_output("gpg -dq ~/.secret/.passwdnielsddg.gpg", shell=True).strip("\n")

Logs, error

#### Steps to reproduce the error
$ /usr/share/offlineimap3/run
OfflineIMAP 7.3.0
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v3.05, Python v3.9.4, OpenSSL 1.1.1j  16 Feb 2021
Account sync nielsddg:
 *** Processing account nielsddg
 Establishing connection to ********* (nielsddg-remote)
 ERROR: While attempting to sync account 'nielsddg'
  a bytes-like object is required, not 'str'
 *** Finished account 'nielsddg' in 0:00
 a bytes-like object is required, not 'str' *** Processing account nielsddg
 Establishing connection to mail.greenhost.nl:993 (nielsddg-remote)
 ERROR: While attempting to sync account 'nielsddg'
  a bytes-like object is required, not 'str'
 *** Finished account 'nielsddg' in 0:00
nllz commented 3 years ago

Probably linked to this issue - but weirdly enough this occurs in offlineimap3, which should not happen because it is a python2 - 3 versioning issue.

sebastianschauenburg commented 3 years ago

Have the same issue here, but the offlineimap development apparently happens in offlineimap3 and they also have a corresponding issue report. I'd suggest following that one.

nicolas33 commented 3 years ago

offlineimap won't support python3. Please, check offlineimap3 as mentioned.