Enclosure plugin bug (and fix)

seems the enclosure plugin has not been updated for OctoPrint 1.4.x
in the PrintDone event, it's still trying to use file which is deprecated
it should be using name to get the filename

without this change it throws an error:

2020-08-28 15:50:27,119 - octoprint.plugin - ERROR - Error while calling plugin enclosure Traceback (most recent call last): File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 230, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_enclosure/__init__.py", line 1573, in on_event file_name = os.path.basename(payload["file"]) KeyError: 'file'

You may have a look on the author github site:

oh dear, poor chap!
I may get in touch with him
thanks for pointing me in that direction

Yeah, I feel bad for him.

I forked, fixed and raised a pull request (I think!)
just waiting for Vitor to integrate

2 Likes