[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3784] trunk/py/scripts/addons/ io_scene_x3d/import_x3d.py: fix [#32612] VRML import does not handle spaces in url's correctly

Campbell Barton ideasman42 at gmail.com
Fri Sep 21 00:15:08 CEST 2012


Revision: 3784
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3784
Author:   campbellbarton
Date:     2012-09-20 22:15:06 +0000 (Thu, 20 Sep 2012)
Log Message:
-----------
fix [#32612] VRML import does not handle spaces in url's correctly

patch by Alan Hudson

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_x3d/import_x3d.py

Modified: trunk/py/scripts/addons/io_scene_x3d/import_x3d.py
===================================================================
--- trunk/py/scripts/addons/io_scene_x3d/import_x3d.py	2012-09-20 21:32:12 UTC (rev 3783)
+++ trunk/py/scripts/addons/io_scene_x3d/import_x3d.py	2012-09-20 22:15:06 UTC (rev 3784)
@@ -22,6 +22,7 @@
 
 # This should work without a blender at all
 import os
+import shlex
 
 
 def imageConvertCompat(path):
@@ -1173,7 +1174,8 @@
                             else:
                                 value += '\n' + l
 
-                    value_all = value.split()
+                    # use shlex so we get '"a b" "b v"' --> '"a b"', '"b v"'
+                    value_all = shlex.split(value, posix=False)
 
                     def iskey(k):
                         if k[0] != '"' and k[0].isalpha() and k.upper() not in {'TRUE', 'FALSE'}:



More information about the Bf-extensions-cvs mailing list