Closed 3rdvision closed 9 months ago
notify @joamag
Ok, this is fishy :) I'll try to make some unit tests just to make sure we can track the issue properly.
Ohh just noticed the code is inside a closure that's probably it.
Thanks @3rdvision this is now fixed!
Thanks for the quick action :+1:
Looking forward to the next release with this fix.
Done, version 0.25.1 has been released. https://github.com/hivesolutions/appier-extras/actions/runs/7758046128 https://pypi.org/project/appier-extras/#history
Bug description
When defining a resizable image for e.g with:
and later calling to get the output data using:
it will throw the error `cannot access local variable 'resample':
Details
This is related to a recent change.
Although the logic implemented makes sense and initially the method defines
resample=None
in the python's locals, when we call the innerget_data
method, theresample
is no longer defined, probably due to a strange unexpected python interpreter response that cleans up the variable thinking it won't be used.This was later verified to be true by changing the
if resample == None: resample = (...)
to something else to not trick python interpreter into thinking thatresample
will always be defined.I think this is a very strange behavior and might be a python issue.
Incoming PR with a working fix suggestion.
Environment
Python 3.11.6