io_scene_x3d - WRL import fails when Python 3.11 is used #106210 #104510

Closed
opened 2023-03-28 10:36:23 +02:00 by Michael-Billington · 1 comment

System Information
Operating system: Linux-6.1.0-6-amd64-x86_64-with-glibc2.36 64 Bits
Graphics card: AMD Radeon RX 580 Series (polaris10, LLVM 15.0.6, DRM 3.49, 6.1.0-6-amd64) AMD 4.6 (Core Profile) Mesa 22.3.6

Blender Version
Broken: version: 3.4.1 - Debian package installed via apt on testing distribution ("bookworm")
Worked: Official release of Blender 3.4.1 is unaffected.

Short description of error

The io_scene_x3d plugin uses a flag which was removed in Python 3.11 when importing WRL files.

The soon-to-be-released Debian Bookworm ships with Python 3.11, and when I attempt to import any WRL file, it appears to do nothing. An error is however printed on the command-line, 'ValueError: invalid mode: 'rU' - full output is attached.

Removing the character U from the line identified in the stacktrace restored the ability to complete a WRL import for me - diff also attached.

Posting this on the assumption that support for newer Python versions is desirable in add-ons - I'm aware that 3.10 is the shipped/supported version of Python for Blender 3.4.

Exact steps for others to reproduce the error

Install blender via the apt package manager on Debian bookworm, or switch to a Python 3.11 interpreter in some easier way if possible.

Launch from command-line.

From default cube, File -> Import -> X3D Extensible 3D (.x3d/.wrl).

Select the test.wrl file attached to this issue. I don't believe this issue is file-specific, but this is a model of an electronic component from the KiCad project, and I've attached a picture FreeCAD opening the file just to indicate that it is not empty/corrupt.

Observe nothing happens, and error is printed on command-line.

Apply fix, restart blender, repeat import.

Observe that the model now imports.

**System Information** Operating system: Linux-6.1.0-6-amd64-x86_64-with-glibc2.36 64 Bits Graphics card: AMD Radeon RX 580 Series (polaris10, LLVM 15.0.6, DRM 3.49, 6.1.0-6-amd64) AMD 4.6 (Core Profile) Mesa 22.3.6 **Blender Version** Broken: version: 3.4.1 - Debian package installed via `apt` on testing distribution ("bookworm") Worked: Official release of Blender 3.4.1 is unaffected. **Short description of error** The `io_scene_x3d` plugin uses a flag which was [removed in Python 3.11](https://docs.python.org/3/whatsnew/3.11.html#porting-to-python-3-11) when importing WRL files. The soon-to-be-released Debian Bookworm ships with Python 3.11, and when I attempt to import any WRL file, it appears to do nothing. An error is however printed on the command-line, `'ValueError: invalid mode: 'rU'` - full output is attached. Removing the character `U` from the line identified in the stacktrace restored the ability to complete a WRL import for me - diff also attached. Posting this on the assumption that support for newer Python versions is desirable in add-ons - I'm aware that 3.10 is the shipped/supported version of Python for Blender 3.4. **Exact steps for others to reproduce the error** Install blender via the `apt` package manager on Debian bookworm, or switch to a Python 3.11 interpreter in some easier way if possible. Launch from command-line. From default cube, File -> Import -> X3D Extensible 3D (.x3d/.wrl). Select the `test.wrl` file attached to this issue. I don't believe this issue is file-specific, but this is a model of an electronic component from the KiCad project, and I've attached a picture FreeCAD opening the file just to indicate that it is not empty/corrupt. Observe nothing happens, and error is printed on command-line. Apply fix, restart blender, repeat import. Observe that the model now imports.
Michael-Billington added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-28 10:36:24 +02:00

Looks like something for @ideasman42 to take a look at, as he keeps new versions of python compatible with Blender.

Looks like something for @ideasman42 to take a look at, as he keeps new versions of python compatible with Blender.
Blender Bot added
Status
Resolved
and removed
Status
Needs Info from Developers
labels 2023-04-06 11:46:25 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#104510
No description provided.