Page MenuHomekolab.org

Bugs logged for pykolab
Open, Needs TriagePublic

Description

Centos 7/Winterfell
pykolab-0.9.0-2.2.el7.kolab_wf.noarch

Since some days every 5 Minutes an error gets logged by pykolab, everything works but it is quite annoying...

2022-09-03 08:33:22,375 pykolab.auth ERROR [20004] An error occured using _persistent_search: TypeError('an integer is required',)
2022-09-03 08:33:22,376 pykolab.auth ERROR [20004] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 3219, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2931, in _persistent_search
    secondary_domains=secondary_domains
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2761, in _synchronize_callback
    eval("self._change_none_%s(entry, change_dict)" % (entry['type']))
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2310, in _change_none_user
    if not self.imap.user_mailbox_exists(entry[result_attribute]):
  File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 862, in user_mailbox_exists
    return self.has_folder('user%s%s' %(self.get_separator(), mailbox_base_name))
  File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 898, in has_folder
    log.debug(_("Looking for folder '%s', we found folders: %r") % (folder, [self.folder_utf8(x) for x in folders]), level=8)
  File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 302, in folder_utf8
    return imap_utf7.decode(folder)
  File "/usr/lib/python2.7/site-packages/pykolab/imap_utf7.py", line 116, in decode
    res.append(chr(c))
TypeError: an integer is required

2022-09-03 08:33:22,444 pykolab.auth ERROR [20004] An error occured using _paged_search: TypeError('an integer is required',)
2022-09-03 08:33:22,445 pykolab.auth ERROR [20004] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 3219, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2983, in _paged_search
    callback(entry=_result_data)
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2814, in _synchronize_callback
    eval("self._change_none_%s(entry, None)" % (entry['type']))
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2310, in _change_none_user
    if not self.imap.user_mailbox_exists(entry[result_attribute]):
  File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 862, in user_mailbox_exists
    return self.has_folder('user%s%s' %(self.get_separator(), mailbox_base_name))
  File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 898, in has_folder
    log.debug(_("Looking for folder '%s', we found folders: %r") % (folder, [self.folder_utf8(x) for x in folders]), level=8)
  File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 302, in folder_utf8
    return imap_utf7.decode(folder)
  File "/usr/lib/python2.7/site-packages/pykolab/imap_utf7.py", line 116, in decode
    res.append(chr(c))
TypeError: an integer is required

Details

Ticket Type
Task

Event Timeline

thozie created this task.Sep 3 2022, 8:41 AM

I believe there's an integer conversion missing in line 116 of pykolab/imap_utf7.py - it should probably be:

res.append(chr(int(c)))

Correction: that simple fix apparently doesn't do the trick.

ghane added a subscriber: ghane.Fri, Sep 30, 1:12 PM

D3851

res.append(c)

Just remove chr()
c is single character of a string, but not an integer value of a character.
I could see via grep, decode(s) is used with folders in modules used for imap

for c in s:

See also https://git.kolab.org/diffusion/P/browse/pykolab-0.7/pykolab/imap_utf7.py line 52 , 74