Package: offlineimap
Version: 7.3.3+dfsg1-1+0.0~git20211018.e64c254+dfsg-2.1
Severity: important

Greetings!

Thank you for maintaining offlineimap.

When I run offlineimap, several of my mailboxes fail to sync because are
attempting access symbols in the fcntl module in Python while the module is not
imported.

The problem comes from these lines 30-36 of offlineimap/imaplibutil.py in the
current verions of the Debian package in bookworm and sid:

> try:
>     import portalocker
> except:
>     try:
>         import fcntl
>     except:
>         pass  # Ok if this fails, we can do without.

The problem is because (a) I have portalocker installed on my system and (b)
the function "set_nonblocking" defined on line 140 of the same file relies on
fcntl being available.

I've not attached a patch because I'm not sure how to best to fix this.

I've fixed this on my system by simply importing fcntl in a line above the
quoted chunk of code above. The fcntl module is in the Python 3.11 standard
library in Python on Linux so it is should be safe. I believe fcntl might not
be installed on Windows.

It might be better to add new code to use portalocker instead of fcntl to the
function on line 140.

If it's helpful, I happy to help prepare a patch if you give me direction on
how you want to solve the problem.

Regards,
Mako


-- System Information:
Debian Release: 11.6
  APT prefers stable-updates
  APT policy: (990, 'stable-updates'), (990, 'stable-security'), (990, 
'stable'), (500, 'testing'), (100, 'bullseye-fasttrack'), (100, 
'bullseye-backports-staging')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-1-amd64 (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_USER, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages offlineimap depends on:
ii  offlineimap3  0.0~git20211018.e64c254+dfsg-2

offlineimap recommends no packages.

offlineimap suggests no packages.

-- no debconf information

Reply via email to