Skip to content

Error in Node.load when node contains an inline comment #161

Closed

Description

@cwhanse

Attempting to read these Example files with pycollada and I'm getting an error because an inline comment is treated as if it is a subnode:

COLLADA file excerpt that errors, the subnode that is the problem has subnode.text equal to the comment text " We instantiate the rack model "

	<library_nodes>
		<!-- We define the model for a table with 1 rack -->
		<node id="TableModel1">
			<!-- We instantiate the rack model -->
			<instance_geometry url="#Rack1Model">
				<bind_material>

To reproduce

import collada
from collada import Collada

dirn = 'D:\\PVCollada\\schema\\pvcollada\\Examples\\PVCollada_2.0'
filen = '\\01 - VerySimpleFixedPVC2_without_electrical_layout.pvc2'

mesh = Collada(dirn + filen)

produces (at the tail of the traceback):

File D:\python\pycollada\pycollada\collada\__init__.py:248, in Collada.handleError(self, error)
    244 # use `isinstance` to check this error which will
    245 # correctly identify subclasses, i.e. if `DaeError`
    246 # is passed as the ignore it will ignore everything
    247 if not any(isinstance(error, mask) for mask in self.maskedErrors):
--> 248     raise

RuntimeError: No active exception to reraise

What's the suggested workaround besides deleting comments from the COLLADA file? I don't follow the importer sufficiently or I would submit a PR to fix.

Many thanks.

Activity

  1. jterrace commented on May 23, 2026

    @jterrace
    Member

    Those look like collada 1.5 files? That could be part of the problem (see #25)

  2. cwhanse commented on May 25, 2026

    @cwhanse
    Author

    I removed that one comment line from the file to get past the error. The rest of the file appears to load correctly.

    I didn't see that pycollada was specific to COLLADA version so thanks for pointing out that branch for 1.5.

  3. cwhanse commented on Oct 19, 2026

    @cwhanse
    Author

    Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions