Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curses error in blinkenlights with a tiny screen #595

Closed
dopefishh opened this issue Jan 31, 2019 · 0 comments
Closed

Curses error in blinkenlights with a tiny screen #595

dopefishh opened this issue Jan 31, 2019 · 0 comments

Comments

@dopefishh
Copy link
Contributor

General informations

  • system/distribution (with version): Debian GNU/Linux buster/sid x86
  • offlineimap version (offlineimap -V): offlineimap v7.2.2, imaplib2 v2.57 (system), Python v2.7.15+, OpenSSL 1.1.1a 20 Nov 2018
  • Python version: Python v2.7.15+
  • server name or domain: irrelevant
  • CLI options: offlineimap -o

Configuration file offlineimaprc

[general]
pythonfile = ~/.config/offlineimap/offlineimap.py
metadata = ~/.local/share/offlineimap
accounts = net
ui = blinkenlights

[Account net]
localrepository = Local
remoterepository = Remote
autorefresh = 0.5
quick = 10
postsynchook = newmail.sh

[Repository Local]
type = Maildir
localfolders = ~/.local/share/offlineimap/mail

[Repository Remote]
type = IMAP
folderfilter = lambda x: folderfilter(x)
remotepasseval = mailpasswd()
remotehost = REDACTED
remoteuser = REDACTED
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
keepalive = 60
holdconnectionopen = yes

[mbnames]
enabled = yes
filename = ~/.local/share/offlineimap/mailboxes
header = "mailboxes "
peritem = "~/.local/share/offlineimap/mail/%(foldername)s/"
sep = " "
footer = "\n"
incremental = yes

pythonfile (if any)

import subprocess
import datetime
import re


def mailpasswd():
    return subprocess.check_output('pass REDACTED',
                                   shell='/bin/bash').strip()


def folderfilter(x):
    match = re.match('archive\.(\d\d\d\d).(\d\d)', x)
    if match:
        return abs(datetime.date.today() -
                   datetime.date(int(match.group(1)), int(match.group(2)), 1)
                   ).days <= 31*6
    else:
        return not x.startswith('archive') and not (x == "INBOX.Junk")

Logs, error

For every synced mailbox I get:

ERROR: ERROR in syncfolder for net folder REDACTED: Traceback (most recent call last):
  File "/usr/share/offlineimap/offlineimap/accounts.py", line 599, in syncfolder
    ui.syncingfolder(remoterepos, remotefolder, localrepos, localfolder)
  File "/usr/share/offlineimap/offlineimap/ui/Curses.py", line 431, in syncingfolder
    self.gettf().setcolor('cyan')
  File "/usr/share/offlineimap/offlineimap/ui/Curses.py", line 210, in setcolor
    self.display()
  File "/usr/share/offlineimap/offlineimap/ui/Curses.py", line 217, in display
    self.ui.exec_locked(locked_display)
  File "/usr/share/offlineimap/offlineimap/ui/Curses.py", line 94, in exec_locked
    target(*args, **kwargs)
  File "/usr/share/offlineimap/offlineimap/ui/Curses.py", line 214, in locked_display
    self.window.addch(self.y, self.x, '@', self.curses_color)
error: addch() returned ERR

  addch() returned ERR

Steps to reproduce the error

  • Run offlineimap -o with the blinkenlights UI
  • Have a terminal with very little columns (mine was only 28 columns wide)

addch errors when the coordinates are outside of the window, this happens if the screen is very very small.

nicolas33 pushed a commit that referenced this issue Feb 13, 2019
addch() and addstr() throw an exception if text has to be printed
outside of the window. This may occur if the terminal is very small.
Such erroneous prints are no-ops now.

Signed-off-by: Mart Lubbers <mart@martlubbers.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Github-ref: #595
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants