uskudnik / amazon-glacier-cmd-interface

Command line interface for Amazon Glacier
MIT License
374 stars 100 forks source link

Upload from stdin fails at the end #113

Open sirloon opened 11 years ago

sirloon commented 11 years ago

Hi guys, Just tried latest sources, uploading a file to Glacier from stdin. I got the following error:

Traceback (most recent call last):
File "/opt/local/bin/glacier-cmd", line 8, in load_entry_point('glacier==0.2dev', 'console_scripts', 'glacier-cmd')() File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/glacier.py", line 751, in main args.func(args) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/glacier.py", line 147, in wrapper return fn(_args, _kwargs) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/glacier.py", line 313, in upload args.name, args.partsize, args.uploadid, args.resume) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py", line 62, in wrapper ret = fn(_args, _kwargs) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py", line 221, in glacier_connect_wrap return func(_args, _kwargs) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py", line 62, in wrapper ret = fn(_args, _kwargs) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py", line 274, in sdb_connect_wrap return func(_args, _kwargs) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py", line 62, in wrapper ret = fn(_args, _kwargs) File "/opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py", line 1142, in upload f.close() UnboundLocalError: local variable 'f' referenced before assignment bash-3.2# vim /opt/local/lib/python2.6/site-packages/glacier-0.2dev-py2.6.egg/glacier/GlacierWrapper.py +1142

Indeed, f (a file handler) won't exist when uploading from stdin (that was the case). Something wrong GlacierWrapper while releasing resources.

Thanks Seb