bpy.ops.wm.url_open() can no longer open html files in the filesystem #116280

Closed
opened 2023-12-17 19:41:27 +01:00 by MACHIN3 · 5 comments

System Information
Operating system: Linux-6.5.6-76060506-generic-x86_64-with-glibc2.35 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3080 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 545.29.06

Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked: 3.5

Short description of error
Up until 3.5 you could pass the file path of an html file to the url arg of bpy.ops.wm.open_url which would conveniently open said html in the user's web browser. This is very useful if one supplies documentation locally, and so documentation,, that is accessible without an internet connection.

It appears this has stopped working starting with Blender 3.6.

See https://youtu.be/89LHf_lu0Oc for a little demo of the attached blend file + script + index.html file.

In Blender 3.5 the file path of the index.html file is properly translated into this file system url:
file:///home/something/index.html

Starting in Blender 3.6 however, it becomes:
https://home/something/index.html which of course can't work.

I've tried forcing the file system url, but had no luck.

Exact steps for others to reproduce the error

  • extract the attached .zip file
  • in Blender 3.5 open the file wm.url_open_local_html_file.blend and run the script in the text editor
    • index.html will be opened in the web browser
  • in Blender 3.6 and 4.0 open the same .blend file, and run the script again
    • the webrowser will display a Server Not Found page
**System Information** Operating system: Linux-6.5.6-76060506-generic-x86_64-with-glibc2.35 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 3080 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 545.29.06 **Blender Version** Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: 3.5 **Short description of error** Up until 3.5 you could pass the file path of an html file to the `url` arg of `bpy.ops.wm.open_url` which would conveniently open said html in the user's web browser. This is very useful if one supplies documentation locally, and so documentation,, that is accessible without an internet connection. It appears this has stopped working starting with Blender 3.6. See https://youtu.be/89LHf_lu0Oc for a little demo of the attached blend file + script + index.html file. In Blender 3.5 the file path of the index.html file is properly translated into this file system url: `file:///home/something/index.html` Starting in Blender 3.6 however, it becomes: `https://home/something/index.html` which of course can't work. I've tried forcing the file system url, but had no luck. **Exact steps for others to reproduce the error** * extract the attached .zip file * in Blender 3.5 open the file `wm.url_open_local_html_file.blend` and run the script in the text editor * index.html will be opened in the web browser * in Blender 3.6 and 4.0 open the same .blend file, and run the script again * the webrowser will display a *Server Not Found* page
MACHIN3 added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-12-17 19:41:27 +01:00
Jesse Yurkovich changed title from bpy.ops.wm.open_url() can no longer open html files in the filesystem to bpy.ops.wm.url_open() can no longer open html files in the filesystem 2023-12-17 23:07:06 +01:00

Confirmed and caused by a15c637e63 with the move away from calling webbrowser directly.

CC @dfelinto Mind taking a look?

Confirmed and caused by a15c637e63798f61aebb777aca54acaed3bf562c with the move away from calling `webbrowser` directly. CC @dfelinto Mind taking a look?
Jesse Yurkovich added
Module
Python API
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-12-17 23:08:19 +01:00
Pratik Borhade added
Priority
High
and removed
Priority
Normal
labels 2023-12-18 05:56:50 +01:00
Dalai Felinto self-assigned this 2023-12-18 12:48:52 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-12-18 16:44:53 +01:00
Author

Thanks to all involved!

Thanks to all involved!
Author

Please bring this to 4.1. I thought it was in 4.0 already, but seems like it isn't. Thanks.

Correction: it works, in 4.1 again, but the local url has to be explicitly prefaced with the protocol now, so "file://" + "/my/path/to/file.html" for instance.

Please bring this to 4.1. I thought it was in 4.0 already, but seems like it isn't. Thanks. Correction: it works, in 4.1 again, but the local url has to be explicitly prefaced with the protocol now, so "file://" + "/my/path/to/file.html" for instance.

@MACHIN3 can you create a new report and mention this report there? The original report was about file:///, and this is working.

To open url=/home/foo.html was not considered (and I’m not sure if we should, but we can have this discussion on its own report).

@MACHIN3 can you create a new report and mention this report there? The original report was about file:///, and this is working. To open url=/home/foo.html was not considered (and I’m not sure if we should, but we can have this discussion on its own report).
Author

No it's fine by me. Good to be explicit with the url. It did work earlier (3.5) without it before, that's why I thought the fix was not merged yet. No need to open a new issue from my POV.

No it's fine by me. Good to be explicit with the url. It did work earlier (3.5) without it before, that's why I thought the fix was not merged yet. No need to open a new issue from my POV.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
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#116280
No description provided.