Sublime Forum

Python docstring highlighter misses close-string token

#1

It seems in ST2 2181, the syntax highlighter is breaking in the docstring for this function:

    def create_user(self):
        """CREATE this USER.

        Beware that this method is open to SQL injection attack.  Don't use
        unvetted values of self.user.
        """
        self.super_psql('-c', "CREATE USER %s" % self.user])

    def drop(self):
        """DROP this DATABASE, if it exists."""
        self.super_psql('-c', "DROP DATABASE IF EXISTS %s" % self.db_name])

Here’s how it’s rendered. As you can see, despite the closing triple quote, the highlighter thinks the remainder of the file is part of the create_user.doc. Apparently, this is caused by two things, the CREATE characters at the beginning of the docstring and the apostrophe in “Don’t” later in the docstring. Remove either of those, and the syntax highlighting returns to normal.

0 Likes