*** failed to import extension kilnauth from ~/KilnExtensions/kilnauth.py: invalid syntax

You might run into this error message if you’ve got an older version of python installed. The problem is the newer with syntax:

        with open(self.__temporary_path, 'r') as f:
            before = md5(f.read()).digest()

The solution is to just convert it to try/finally

        f = open(self.__temporary_path, 'rb')
        try:
            before = md5(f.read()).digest()
        finally:
            f.close()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.