Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the error message when a file cannot be opened for reading #1341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion S3/S3.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def object_put(self, filename, uri, extra_headers = None, extra_label = ""):
size = stat[ST_SIZE]
src_stream.stream_name = filename
except (IOError, OSError) as e:
raise InvalidFileError(u"%s" % e.strerror)
raise InvalidFileError(u"failed to open the file for reading (%s)" % e.strerror)

headers = SortedDict(ignore_case=True)
if extra_headers:
Expand Down
2 changes: 1 addition & 1 deletion s3cmd
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def cmd_object_put(args):
ret = EX_PARTIAL
continue
except InvalidFileError as exc:
error(u"Upload of '%s' is not possible (Reason: %s)" % (full_name_orig, exc))
error(u"Upload of '%s' is not possible. Reason: %s." % (full_name_orig, exc))
ret = EX_PARTIAL
if cfg.stop_on_error:
ret = EX_OSFILE
Expand Down