Fix #3788. Fix crash when opening drawing SVGs using webbrowser module which is not recommended and the file is on a Dropbox synced external drive. Now replaced with generic os.startfile / xdg-open / open commands.

This commit is contained in:
Dion Moult
2023-09-27 11:50:43 +10:00
parent f1a5805b1c
commit e93a697179
5 changed files with 7 additions and 6 deletions
@@ -22,7 +22,6 @@ import json
import ifccsv
import logging
import tempfile
import webbrowser
import ifcopenshell
import blenderbim.tool as tool
from blenderbim.bim.ifc import IfcStore
@@ -26,7 +26,6 @@ import shutil
import hashlib
import shapely
import subprocess
import webbrowser
import numpy as np
import multiprocessing
import ifcopenshell
@@ -21,7 +21,6 @@ import bpy
import json
import logging
import tempfile
import webbrowser
import ifcopenshell
import blenderbim.tool as tool
@@ -23,7 +23,6 @@ import time
import calendar
import isodate
import pystache
import webbrowser
import blenderbim.core.sequence as core
import blenderbim.tool as tool
import blenderbim.bim.module.sequence.helper as helper
+7 -2
View File
@@ -26,9 +26,9 @@ import bmesh
import shutil
import logging
import shapely
import platform
from shapely.ops import unary_union
import mathutils
import webbrowser
import subprocess
import numpy as np
import blenderbim.core.tool
@@ -834,7 +834,12 @@ class Drawing(blenderbim.core.tool.Drawing):
command[0] = shutil.which(command[0]) or command[0]
subprocess.Popen([replacements.get(c, c) for c in command])
else:
webbrowser.open("file://" + path)
if platform.system() == "Darwin":
subprocess.call(("open", path))
elif platform.system() == "Windows":
os.startfile(path)
else:
subprocess.call(("xdg-open", path))
@classmethod
def open_spreadsheet(cls, uri):