different errors after switching from python 2.7 to 3.6

  • Hello!

    I just compiled kopanocore and switched to python 3.6.

    Up to now I found two issues:

    1. kopano-search does not start
      I get:
    Traceback (most recent call last):
      File "/usr/sbin/kopano-search", line 4, in <module>
        import kopano_search
      File "/usr/lib64/python3.6/site-packages/kopano_search/__init__.py", line 17, in <module>
        from Queue import Empty
    ModuleNotFoundError: No module named 'Queue'

    After changing:

    from Queue import Empty


    from queue import Empty

    init.py” file from kopano search it works.

    1. kopano-presence throws errors:
    [2018-12-25 12:17:53,546] ERROR in app: Exception on / [PUT]
    Traceback (most recent call last):
      File "/usr/lib64/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
        response = self.full_dispatch_request()
      File "/usr/lib64/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "/usr/lib64/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/lib64/python3.6/site-packages/flask/_compat.py", line 35, in reraise
        raise value
      File "/usr/lib64/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
        rv = self.dispatch_request()
      File "/usr/lib64/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
      File "/usr/lib64/python3.6/site-packages/kopano_presence/__init__.py", line 94, in put
      File "/usr/lib64/python3.6/site-packages/kopano_presence/__init__.py", line 73, in check_auth
        if (sha256 != hmac.new(secret_key, '%s:%s' % (t, userid), hashlib.sha256).digest().encode('base64').strip().upper()) or \
      File "/usr/lib64/python3.6/hmac.py", line 144, in new
        return HMAC(key, msg, digestmod)
      File "/usr/lib64/python3.6/hmac.py", line 42, in __init__
        raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
    TypeError: key: expected bytes or bytearray, but got 'str' - - [25/Dec/2018 12:17:53] "PUT / HTTP/1.1" 500 -

    Haven’t found out what do here…

Log in to reply