VRML import fails with ValueError: No closing quotation when VRML contains multi-line VRMLscript #101717

Open
opened 2022-10-10 07:26:38 +02:00 by Seth Gold · 3 comments

System Information
Operating system: Windows 10
Graphics card: NVIDIA GeForce RTX 2070/PCIe/SSE2

Blender Version
Broken: version: 3.2.2, branch: master, commit date: 2022-08-02 18:15, hash: bcfdb14560e7, type: release
build date: 2022-08-02, 23:41:46
Worked: ???

Short description of error

Try to import a VRML file with an embedded VRML script that spans multiple lines

Error message of ValueError: No closing quotation

Sample taken from http://www.lighthouse3d.com/vrml/tutorial/script.shtml?sehl

I believe the importer is not including the closing quote

                    quote_count = l.count('"')
                    if quote_count % 2:  # odd number?
                        # print('MULTILINE')
                        while 1:
                            i += 1
                            l = lines[i]
                            quote_count = l.count('"')
                            if quote_count % 2:  # odd number?
                                value += '\n' + l[:l.rfind('"')]
                                break  # assume
                            else:
                                value += '\n' + l

                    # use shlex so we get '"a b" "b v"' --> '"a b"', '"b v"'
                    value_all = shlex.split(value, posix=False)

highligh3.wrl

**System Information** Operating system: Windows 10 Graphics card: NVIDIA GeForce RTX 2070/PCIe/SSE2 **Blender Version** Broken: version: 3.2.2, branch: master, commit date: 2022-08-02 18:15, hash: bcfdb14560e7, type: release build date: 2022-08-02, 23:41:46 Worked: ??? **Short description of error** Try to import a VRML file with an embedded VRML script that spans multiple lines Error message of ValueError: No closing quotation Sample taken from http://www.lighthouse3d.com/vrml/tutorial/script.shtml?sehl I believe the importer is not including the closing quote ``` quote_count = l.count('"') if quote_count % 2: # odd number? # print('MULTILINE') while 1: i += 1 l = lines[i] quote_count = l.count('"') if quote_count % 2: # odd number? value += '\n' + l[:l.rfind('"')] break # assume else: value += '\n' + l # use shlex so we get '"a b" "b v"' --> '"a b"', '"b v"' value_all = shlex.split(value, posix=False) ``` [highligh3.wrl](https://archive.blender.org/developer/F13646644/highligh3.wrl)
Author

Added subscriber: @Seth-Gold

Added subscriber: @Seth-Gold
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

It's not only for VRMLScript but also, at least, for "description" attributes. I imagine the problem is wider and concerns every multilines string.

      Anchor
      {
         description "W021 001 (Fenêtre à 1 vant
ail (#01))"
It's not only for VRMLScript but also, at least, for "description" attributes. I imagine the problem is wider and concerns every multilines string. ``` Anchor { description "W021 001 (Fenêtre à 1 vant ail (#01))" ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#101717
No description provided.