Skip to content

Support all seek whence values#102

Merged
nateprewitt merged 3 commits intoboto:developfrom
dbnicholson:fix-zero-len-files
Apr 13, 2021
Merged

Support all seek whence values#102
nateprewitt merged 3 commits intoboto:developfrom
dbnicholson:fix-zero-len-files

Conversation

@dbnicholson
Copy link
Copy Markdown
Contributor

This supersedes #88 and takes into account the comments in #88 (review). In particular, it handles the ReadFileChunk abstraction as suggested by @kyleknap and adds some tests for seeking with non-0 whence values. I squashed my ReadFileChunk changes in @kamalmostafa's patch.

@dbnicholson
Copy link
Copy Markdown
Contributor Author

@kyleknap any chance you could take a look at this? It would be really nice to be able to use this library from python3.

@dbnicholson
Copy link
Copy Markdown
Contributor Author

Ping. @kyleknap is there anything I can do to facilitate getting this merged?

@aerostitch
Copy link
Copy Markdown

It would be really great to have this merged. Any update?

@KES777
Copy link
Copy Markdown

KES777 commented Nov 16, 2018

ping

@dbnicholson
Copy link
Copy Markdown
Contributor Author

It's been over a year and this makes s3transfer pretty unreliable with python3. What will it take to get this merged? I've been using this patch in our projects for @endlessm and have not seen any issues with it. Would you prefer a patch to make s3transfer fail when imported on python3?

@emulanob
Copy link
Copy Markdown

Any plans on merging this?

@SkyMack
Copy link
Copy Markdown

SkyMack commented Sep 11, 2019

Ran into this seek issue today, looks like the original fix was put up in a PR a couple of years ago, and this PR from January accounts for the review comments originally made... pinging some of the recent maintainers to see if anything else needs to happen before it can be merged: @jamesls @kyleknap @JordonPhillips

kamalmostafa and others added 3 commits April 13, 2021 09:28
Bug: aws/aws-cli#2403
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1696800

As described in the bug reports referenced above, trying to copy a
zero-length file to S3 fails (with some version combinations of python3,
awscli, s3transfer, and requests) like this:

    $ aws s3 cp emptyfile s3://somebucket
    upload failed: ./emptyfile to s3://somebucket/emptyfile seek() takes 2 positional arguments but 3 were given

... due to the incomplete implementation of seek() -- missing the optional
'whence' argument -- in s3transfer's ReadFileChunk method.  This patch
adds the whence argument to all of s3transfer's seek implementations.
Check that seek from current position (whence = 1) or seek from end
(whence = 2) work properly with both ReadFileChunk implementations.
@nateprewitt
Copy link
Copy Markdown
Contributor

Alright, I think we're finally ready to ship this! I've added some additional changes onto the original commits from @dbnicholson and @kamalmostafa to prevent some edge case failures. We'd expect this to go out in the next patch version release of s3transfer. Thanks for the feedback and contributions here everyone!

Copy link
Copy Markdown
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. 🚢 Thanks everyone for helping out with this.

@nateprewitt nateprewitt merged commit f840c05 into boto:develop Apr 13, 2021
@dbnicholson dbnicholson deleted the fix-zero-len-files branch February 28, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants