Hello All,
I am a new user of Bottle and I keep getting the following error:
sys:1: ResourceWarning: unclosed file <_io.BufferedRandom name=5>
I have a form where the client uploads an image, the image gets saved to the image folder correctly.
However when the form reloads and posted again I get the above mentioned error.
My code:
@post('/stockcount')
def database_update():
sku = request.forms.get('sku')
description = request.forms.get('description')
image_folder = 'images/'
img = request.files.get('image')
img.save(image_folder)
return template('views/index.tpl', form=form)
My setup is:
- Ubuntu 18.04.3 LTS
- Both Bottle.py stable AND Bottle 13-Dev ( I tried both, got same error)
- Python 3.6.8
- Virtualenv
Any help will be greatly appreciated.
Best Regards,
John.