Your message dated Mon, 22 Feb 2021 22:03:58 +0000
with message-id <e1lejj8-0001q8...@fasolo.debian.org>
and subject line Bug#983249: fixed in offlineimap3 
0.0~git20210218.76c7a72+dfsg-1
has caused the Debian Bug report #983249,
regarding offlineimap3: sequence item 1: expected str instance, bytes found
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
983249: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983249
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: offlineimap3
Version: 0.0~git20210105.00d395b+dfsg-3
Severity: important

Dear Maintainer,

offlineimap fails with:

sequence item 1: expected str instance, bytes found

while trying to sync an imap folder with

pythonfile = ~/.config/offlineimap.py

that looks up username and password:

remoteusereval = get_username("account")

while get_username returns a string, the value gets converted into bytes in

/usr/share/offlineimap3/offlineimap/repository/IMAP.py
...
    def getuser(self):
            ...
            if user is not None:
                return localeval.eval(user).encode('UTF-8')


due to that, the following fails:

/usr/share/offlineimap3/offlineimap/imapserver.py
...
    def __plainhandler(self, response):

tries to mix bytes and strings:

        retval = NULL.join((authz, authc, passwd))


This has been fixed upstream in 
https://github.com/OfflineIMAP/offlineimap3/pull/50
in the same way it was fixed for passwords in
debian/patches/0001-Right-format-for-password-from-remotepassfile.patch



-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-3-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages offlineimap3 depends on:
ii  python3           3.9.1-1
ii  python3-distro    1.5.0-1
ii  python3-imaplib2  2.57-5.2

offlineimap3 recommends no packages.

offlineimap3 suggests no packages.

-- no debconf information
>From fa080b8d92944a1692a44e982292ffde8066950a Mon Sep 17 00:00:00 2001
From: Konstantinos Natsakis <5933427+knatsa...@users.noreply.github.com>
Date: Mon, 8 Feb 2021 23:40:32 +0200
Subject: [PATCH] BUG: Right format for username using remoteusereval

Similarly to 7a4285370f338a6653e8bb1a8fb99e3703683b6f, reading the username
using remoteusereval returns a bytes objects instead an utf-8 string.

This patch includes support for both string and bytes objects.

Signed-off-by: Konstantinos Natsakis 
<5933427+knatsa...@users.noreply.github.com>
---
 offlineimap/repository/IMAP.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py
index b732243..e90d30c 100644
--- a/offlineimap/repository/IMAP.py
+++ b/offlineimap/repository/IMAP.py
@@ -206,12 +206,23 @@ def getuser(self):
         Returns: Returns the remoteusereval or remoteuser or netrc user value.
 
         """
-        localeval = self.localeval
-
         if self.config.has_option(self.getsection(), 'remoteusereval'):
             user = self.getconf('remoteusereval')
             if user is not None:
-                return localeval.eval(user).encode('UTF-8')
+                l_user = self.localeval.eval(user)
+
+                # We need a str username
+                if isinstance(l_user, bytes):
+                    return l_user.decode(encoding='utf-8')
+                elif isinstance(l_user, str):
+                    return l_user
+
+                # If is not bytes or str, we have a problem
+                raise OfflineImapError("Could not get a right username format 
for"
+                                       " repository %s. Type found: %s. "
+                                       "Please, open a bug." %
+                                       (self.name, type(l_user)),
+                                       OfflineImapError.ERROR.FOLDER)
 
         if self.config.has_option(self.getsection(), 'remoteuser'):
             # Assume the configuration file to be UTF-8 encoded so we must not

--- End Message ---
--- Begin Message ---
Source: offlineimap3
Source-Version: 0.0~git20210218.76c7a72+dfsg-1
Done: Sudip Mukherjee <sudipm.mukher...@gmail.com>

We believe that the bug you reported is fixed in the latest version of
offlineimap3, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 983...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sudip Mukherjee <sudipm.mukher...@gmail.com> (supplier of updated offlineimap3 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 22 Feb 2021 21:45:56 +0000
Source: offlineimap3
Architecture: source
Version: 0.0~git20210218.76c7a72+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+pyt...@tracker.debian.org>
Changed-By: Sudip Mukherjee <sudipm.mukher...@gmail.com>
Closes: 981949 982970 983249
Changes:
 offlineimap3 (0.0~git20210218.76c7a72+dfsg-1) unstable; urgency=medium
 .
   * New upstream version 0.0~git20210218.76c7a72+dfsg
     - Remove upstream applied patches.
     - Update fixes broken folderincludes. (Closes: #982970)
     - Update fixes remoteusereval config. (Closes: #983249)
   * Fix reading password from Curses Blinkenlights. (Closes: #981949)
   * Fix gmail fetch with synclabels enabled.
Checksums-Sha1:
 4725cc3b1336f30ead3633aa6000e329f519e44a 2345 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1.dsc
 635a0652db9cb510d1e3b0fa59ffbe6bc99eb96e 173748 
offlineimap3_0.0~git20210218.76c7a72+dfsg.orig.tar.xz
 81e4b5670617bec65025f360b6a9e44e392cc010 7296 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1.debian.tar.xz
 7a2257940b344e1a167ca2f3b492011af868d488 7373 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1_amd64.buildinfo
Checksums-Sha256:
 72aa1c049cb88d0c9fa1d7b481444772255908163d3d826d7003f0f1f6a20e8b 2345 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1.dsc
 bf4c56925056b48223927d2dbfb4e2c008a9ca2f3b6820415d6cf88bb1cca6ca 173748 
offlineimap3_0.0~git20210218.76c7a72+dfsg.orig.tar.xz
 f3fe42db93b7659e5cf595156b1f72f4770bb517ceb8b87118393201dde242e0 7296 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1.debian.tar.xz
 7e7ad79f908d9c77425820dea51baebc0cd0e558c9e42e451ad86d94a98d9fe7 7373 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1_amd64.buildinfo
Files:
 98b464ca731aef4c655ed811eb403b98 2345 mail optional 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1.dsc
 7f1c74b3a8be4fd1a8cd6efc5a8879be 173748 mail optional 
offlineimap3_0.0~git20210218.76c7a72+dfsg.orig.tar.xz
 8bc4a0464d76af222848a8ef420f2c90 7296 mail optional 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1.debian.tar.xz
 c483ba560dac3268f1fe7681db84ee99 7373 mail optional 
offlineimap3_0.0~git20210218.76c7a72+dfsg-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEuDQJkCg9jZvBlJrHR5mjUUbRKzUFAmA0Js8ACgkQR5mjUUbR
KzUuEw/+NsvRcEUcXfjOR06AnxzX+ULaUsRvQ268yphJ2h1PxzxGOYSZY3sOEGWO
geptzPfZBHaWK48a0DB/gOl50v5odrcxTRj74wH4H4fAv3hW5iwNtRZPN2vxeVeH
NKORoiPylEaJv0jYIWiK/3aESd/AdESRDPG0/Ljbu4IAh7A+9LGYUSqbUdAUPrtK
C0/01xFR58xz6ld7K6Ncbr5AJha4KtogyNsJPQ12yWJ1vUuhO8y+HnM7sRG5c5bc
iE0JLPYkeZHdXTtt6R4nMX7McWlNyHhVFMF/CeH/6dIdjUVOEQriIVETPmFPc+3d
f+Fmr+dkTH+K9uMz+kHwnrYXb5pK0PVkA6WhOvjTI3fkVZEigbTXTWnJKOFgCrjC
iamc9b1ovvLXCP2e3/K0XzT2qO4UbvftLiN8aIzfVxEQKSj+fJ3Jg0xY2jdCoAS6
BdvUpUsubRra9tny86fDlaLQXvoBzK8lC5bpkgLYciC+N4uR38kLG35aXDZO2sCl
OOHZODhzEU2gJuusxa8Cgs2xn9jGi1GNDwcShvt9lG6bLSI3TiLSjmYzF2s0KQmZ
8c29Hv5oVdQXCXvfmo0EVlu7PA2b8Vexp/D14lwGFGA3j/JFo9YyhqFwbE+N6gZj
qcNEiAa4TxlSF4BPOfOMVDuLhadCNOabk7MlAjHjJqthhHVj7XU=
=L3jc
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to