Fix: Ensure that KeyingSet.bl_description field is properly escaped when using the...
authorJoshua Leung <aligorith@gmail.com>
Tue, 5 Feb 2019 03:21:35 +0000 (16:21 +1300)
committerJoshua Leung <aligorith@gmail.com>
Tue, 5 Feb 2019 03:21:35 +0000 (16:21 +1300)
Previously, if double-quotes appeared in the KeyingSet.bl_description field,
these would cause a syntax error in the resulting .py script export of the
KeyingSet. Since single quotes are even more likely to appear
(e.g. as apostrophes), we now use triple quotes here.

Unreported bug, noticed earlier when investigating T61010.

release/scripts/startup/bl_operators/anim.py

index fa8ca3575a6d9bd4d2d25ac2991e339f2c9c7001..61247f1ae1ead1b61946fd6d6d5827e293285938 100644 (file)
@@ -79,7 +79,7 @@ class ANIM_OT_keying_set_export(Operator):
         f.write("# Keying Set Level declarations\n")
         f.write("ks = scene.keying_sets.new(idname=\"%s\", name=\"%s\")\n"
                 "" % (ks.bl_idname, ks.bl_label))
-        f.write("ks.bl_description = \"%s\"\n" % ks.bl_description)
+        f.write("ks.bl_description = \"\"\"%s\"\"\"\n" % ks.bl_description)
 
         if not ks.is_path_absolute:
             f.write("ks.is_path_absolute = False\n")