Home Download Buy Blog Forum Support

Python docstring highlighter misses close-string token.

Python docstring highlighter misses close-string token.

Postby jaraco on Wed Feb 22, 2012 11:09 am

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

Code: Select all
    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.
Posts: 8
Joined: Thu Jan 26, 2012 6:53 pm

Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 15 guests