Python scripts from core + 424 on Debian 9


in both versions the Python scripts kopano-localize-folders and kopano-mailbox-permissions throw an error.

Traceback (most recent call last):
  File "/usr/sbin/kopano-localize-folders", line 114, in <module>
  File "/usr/sbin/kopano-localize-folders", line 88, in main
    print('%s: Changing localized folder names to \"%s\"' % ('utf-8'), options.lang))
AttributeError: 'str' object has no attribute 'decode'
Traceback (most recent call last):
  File "/usr/sbin/kopano-mailbox-permissions", line 1002, in <module>
  File "/usr/sbin/kopano-mailbox-permissions", line 995, in main
    printUserMailBoxPermissions(session, showall, args)
  File "/usr/sbin/kopano-mailbox-permissions", line 815, in printUserMailBoxPermissions
    store = getStore(session, user)
  File "/usr/sbin/kopano-mailbox-permissions", line 240, in getStore
    usereid = UserAccountsToEntryIDs(session, [username])[0][0]
  File "/usr/sbin/kopano-mailbox-permissions", line 259, in UserAccountsToEntryIDs
    gab = getGlobalAddressbook(session)
  File "/usr/sbin/kopano-mailbox-permissions", line 129, in getGlobalAddressbook
    SPropertyRestriction(RELOP_EQ, PR_AB_PROVIDER_ID, SPropValue(PR_AB_PROVIDER_ID, 'AC21A95040D3EE48B319FBA753304425'.decode('hex'))), # MUIDECSAB
AttributeError: 'str' object has no attribute 'decode'

Any hint for making it work again?

Thank you

Hello @holibert ,

thanks for the report. Master was recently switched to run everything with python3, but not all helper scripts have been updated yet to be compatible with python3.

For the moment you could explicitly run the script with python2. If you know python then a pr is also appreciated (but we will also get to it eventually). See for instructions.

sorry for this, looks like we missed these somehow when testing with python3. I made a PR for kopano-localize-folders. about the other script, would the new kopano-cli also work for your purposes…? (“kopano-cli -u userX” also shows permissions).