[Bf-blender-cvs] [49618b0e18f] master: Fix: Ensure that KeyingSet.bl_description field is properly escaped when using the Export to File operator
Joshua Leung
noreply at git.blender.org
Tue Feb 5 04:25:38 CET 2019
Commit: 49618b0e18f7554dd70ac898d93abc7baf380081
Author: Joshua Leung
Date: Tue Feb 5 16:21:35 2019 +1300
Branches: master
https://developer.blender.org/rB49618b0e18f7554dd70ac898d93abc7baf380081
Fix: Ensure that KeyingSet.bl_description field is properly escaped when using the Export to File operator
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.
===================================================================
M release/scripts/startup/bl_operators/anim.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index fa8ca3575a6..61247f1ae1e 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -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")
More information about the Bf-blender-cvs
mailing list