Skip to content

get fails when output file is stdout #175

Closed
mdomsch opened this Issue May 25, 2013 · 0 comments

1 participant

@mdomsch
s3tools member
mdomsch commented May 25, 2013

Seth Noble sbnoble@dataexpedition.com via s3tools-bugs mailing list:

During a get operation to stdout:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the following lines to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Problem: UnboundLocalError: local variable 'file_exists' referenced before assignment
S3cmd: 1.5.0-alpha3

Traceback (most recent call last):
File "/home/ec2-user/s3cmd-1.5.0-alpha3/s3cmd", line 2102, in
main()
File "/home/ec2-user/s3cmd-1.5.0-alpha3/s3cmd", line 2034, in main
cmd_func(args)
File "/home/ec2-user/s3cmd-1.5.0-alpha3/s3cmd", line 468, in cmd_object_get
if not file_exists: # Delete, only if file didn't exist before!
UnboundLocalError: local variable 'file_exists' referenced before assignment

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the above lines to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Quick Fix:

Set "file_exists = 1" in the ## stdout case above.

@mdomsch mdomsch added a commit to mdomsch/s3cmd that referenced this issue May 25, 2013
@mdomsch mdomsch s3cmd get to stdout: set file_exists to avoid traceback, bug #175
Fixes s3tools#175
Reported by Seth Noble.

Set file_exists so we don't try to delete sys.stdout if getting the
file happens to fail.
d370008
@mdomsch mdomsch closed this Jun 1, 2013
@adoliver adoliver added a commit that referenced this issue Nov 28, 2013
@mdomsch mdomsch s3cmd get to stdout: set file_exists to avoid traceback, bug #175
Fixes #175
Reported by Seth Noble.

Set file_exists so we don't try to delete sys.stdout if getting the
file happens to fail.
dbd3767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.