[Bf-extensions-cvs] [cb5cba3d] master: Fix T70724: PLY import fails with strings

Campbell Barton noreply at git.blender.org
Fri Oct 11 07:25:46 CEST 2019


Commit: cb5cba3da0b11eff19780fc314e1465be398ec36
Author: Campbell Barton
Date:   Fri Oct 11 16:25:22 2019 +1100
Branches: master
https://developer.blender.org/rBAcb5cba3da0b11eff19780fc314e1465be398ec36

Fix T70724: PLY import fails with strings

===================================================================

M	io_mesh_ply/import_ply.py

===================================================================

diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py
index d0deee0a..5da7f9d6 100644
--- a/io_mesh_ply/import_ply.py
+++ b/io_mesh_ply/import_ply.py
@@ -64,7 +64,7 @@ class property_spec(object):
                 ans = []
                 for i in range(count):
                     s = stream[i]
-                    if len(s) < 2 or s[0] != '"' or s[-1] != '"':
+                    if not (len(s) >= 2 and s.startswith(b'"') and s.endswith(b'"')):
                         print('Invalid string', s)
                         print('Note: ply_import.py does not handle whitespace in strings')
                         return None



More information about the Bf-extensions-cvs mailing list