#Blender plug-in disrupts Blender scripting error reporting

1 messages · Page 1 of 1 (latest)

wooden harbor
#

It looks like the Blender plug-in doesn't like it when I run scripts with errors.

I tried the script with the plug-in installed:

import bpy
import random

# Remove all objects
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Set the cube dimensions
cube_dimensions = (0.5, 0.5, 0.5)

# Create 10 cubes
for i in range(10):
    # Generate random x, y, and z coordinates between -5 and 5
    x = random.uniform(-5, 5)
    y = random.uniform(-5, 5)
    z = random.uniform(-5, 5)
    
    # Create the cube at the specified coordinates
    bpy.ops.mesh.primitive_cube_add(location=(x, y, z), size=cube_dimensions)

And I get this useless error:

Python: --- Logging error ---
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.4/python/lib/python3.10/logging/handlers.py", line 74, in emit
    self.doRollover()
  File "/Applications/Blender.app/Contents/Resources/3.4/python/lib/python3.10/logging/handlers.py", line 431, in doRollover
    dfn = self.rotation_filename(self.baseFilename + "." +
  File "/Applications/Blender.app/Contents/Resources/3.4/python/lib/python3.10/logging/handlers.py", line 95, in rotation_filename
    result = self.namer(default_name)
  File "/Users/iangilman/Library/Application Support/Blender/3.4/scripts/addons/AliceLG/__init__.py", line 91, in logfile_namer
    base_filename, ext, date = default_name.split(".")
ValueError: too many values to unpack (expected 3)
Call stack:
  File "/Users/iangilman/Library/Application Support/Blender/3.4/scripts/addons/AliceLG/__init__.py", line 81, in log_exhook
    LookingGlassAddonLogger.critical("An unhandled error occured. Here is the traceback:\n", exc_info=(exc_type, exc_value, exc_traceback))
Message: 'An unhandled error occured. Here is the traceback:\n'
Arguments: ()
#

Whereas if I disable to plug-in, I got this much more sensible error:

Python: An unhandled error occured. Here is the traceback:
Traceback (most recent call last):
  File "/Text", line 17, in <module>
  File "/Applications/Blender.app/Contents/Resources/3.4/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties:  MESH_OT_primitive_cube_add.size expected a float type, not tuple

If I fix the script so it doesn't have the error, it runs fine with or without the AliceLG plug-in. So it seems somehow the plug-in is inserting itself into the error reporting system and screwing things up.

#

I'm using Alice/LG 2.1.0 with Blender 3.4.1 in macOS Ventura.

Of course ideally I would never write scripts that have errors in them, but realistically that's not going to happen, so it's nice to be able to see the actual error messages instead of the AliceLG error! 😄

serene snow
#

Hi, thank you for the bug report. I agree: You should never write scripts that have errors in them – that's the issue. 🤪😂 Just kidding of course. I added this bug as an issue to the GitHub repository and will try to fix it with the next release.

#

The issue most-likely is, that I tried to keep the console output as clean as possible in order to keep the addon from spamming the console. In addition (or maybe that's also the main issue) it also seems like there is an error in the log file creation.

wooden harbor
#

Cool, thank you for looking into it! Meanwhile I'll work on never having errors 🔮