You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
288 except ImportError:
289 if allowFallback:
290 if not self.hasWarnedAboutMissingRTree:
291 sys.stderr.write("Warning: Module 'rtree' not available. Using brute-force fallback\n")
292 self.hasWarnedAboutMissingRTree = True
This environment is not rare or unlikely to encounter. The problem was encountered when using sumolib inside a QGIS Plugin.
When the QGIS Python Console is not open, sys.stderr is not available (sys.stderr == None).
Possible fix:
Check if sys.stderr is available, if not ignore printing the warning.
288 except ImportError:
289 if allowFallback:
290 if not self.hasWarnedAboutMissingRTree:
291 sys.stderr.write("Warning: Module 'rtree' not available. Using brute-force fallback\n") if sys.stderr else ...
292 self.hasWarnedAboutMissingRTree = True
293 else:
294 sys.stderr.write("Error: Module 'rtree' not available.\n") if sys.stderr else ...
295 sys.exit(1)
Add an option to suppress the warning
276 def getNeighboringEdges(self, x, y, r=0.1, includeJunctions=True,
277 allowFallback=True, supressWarning=False):
[...]
288 except ImportError:
289 if allowFallback:
290 if not self.hasWarnedAboutMissingRTree:
291 sys.stderr.write("Warning: Module 'rtree' not available. Using brute-force fallback\n") if not supressWarning else ...
292 self.hasWarnedAboutMissingRTree = True
293 else:
294 sys.stderr.write("Error: Module 'rtree' not available.\n") if not supressWarning else ...
295 sys.exit(1)
Using sumolib.net.getNeighboringEdges in python, when
sumolib crashes: AttributeError: 'NoneType' object has no attribute 'write'
This is caused by https://github.com/eclipse/sumo/blob/main/tools/sumolib/net/__init__.py
This environment is not rare or unlikely to encounter. The problem was encountered when using sumolib inside a QGIS Plugin.
When the QGIS Python Console is not open, sys.stderr is not available (sys.stderr == None).
Possible fix:
SUMO-version:
operating system:
N/A
The text was updated successfully, but these errors were encountered: