Showstopper: Commit 32259ce4491 (lru-cache.py) breaks kopano-search and pyko with python 2.6

Recent changes to pyko break compatibility with python 2.6:
Thus, kopano-search refuses to start, python-kopano scripts are entirely broken.

General question:
Is python 2.6 still a supported target for kopano 8.3.0 ?

Unfixed issue item.py/ PR_TRANSPORT_MESSAGE_HEADERS is presumably 2.6-incompatibility related, too (and btw. can cause severe data-loss with shipped pyko scripts).

Starting kopano-search: Traceback (most recent call last):
  File "/usr/sbin/kopano-search", line 3, in <module>
    import kopano_search
  File "/usr/lib/python2.6/site-packages/kopano_search/__init__.py", line 20, in <module>
    import kopano
  File "/usr/lib/python2.6/site-packages/kopano/__init__.py", line 51, in <module>
    from .config import Config, CONFIG
  File "/usr/lib/python2.6/site-packages/kopano/config.py", line 10, in <module>
    from .compat import decode as _decode
  File "/usr/lib/python2.6/site-packages/kopano/compat.py", line 16, in <module>
    from .lru_cache import lru_cache
  File "/usr/lib/python2.6/site-packages/kopano/lru_cache.py", line 28
    fasttypes = {int, str, frozenset, type(None)},
                    ^
SyntaxError: invalid syntax
[FEHLGESCHLAGEN]

Reason:
We have no set literals in Python 2.6 as used in lru_cache.py:

def _make_key(args, kwds, typed,
             kwd_mark = (object(),),
             fasttypes = {int, str, frozenset, type(None)},
             sorted=sorted, tuple=tuple, type=type, len=len):

needs to be changed to:

def _make_key(args, kwds, typed,
             kwd_mark = (object(),),
             fasttypes = set([int, str, frozenset, type(None)]),
             sorted=sorted, tuple=tuple, type=type, len=len):

verified on Python 2.6.6 /CentOS 6.8
core-8.3.0~849_108.1

bg,
umgfoin.

Hi

@umgfoin said in Showstopper: Commit 32259ce4491 (lru-cache.py) breaks kopano-search and pyko with python 2.6:

needs to be changed to:

def _make_key(args, kwds, typed,
             kwd_mark = (object(),),
             fasttypes = set([int, str, frozenset, type(None)]),
             sorted=sorted, tuple=tuple, type=type, len=len):

verified on Python 2.6.6 /CentOS 6.8
core-8.3.0~849_108.1

Thanks for your report, will make a pull request right away to get it fixed.

Bo

@bosim
Thank you.
Is there any (public) ticket assigned?
'just like to track commits on the issue.

Sadly no ticket for it, but I just merged the related fix, so with the next package update you should be good to go again.

https://stash.kopano.io/projects/KC/repos/kopanocore/commits/610a52510b0036a0436f070bb512e609f7a16136

@fbartels
Felix, thanks, I will update via RHEL6-rpm, tomorrow.

As far as I can see:
The PR_TRANSPORT_MESSAGE_HEADERS(_W) -problem is not part of recent merges.

This seems to be a Python 2.6 compatibility issue, too, with the negative effect, that using the PYKO example-scripts might kill your data if header-filtering fails.

bg umgfoin.