pyfilesystem icon indicating copy to clipboard operation
pyfilesystem copied to clipboard

Support alternate datetime format for S3 files

Open mattharrison opened this issue 9 years ago • 4 comments

This supports alternate formats for S3 buckets

mattharrison avatar Sep 19 '16 15:09 mattharrison

I wonder if using a regex might be more reliable than simply looking for a hyphen? shrug

lurch avatar Sep 19 '16 15:09 lurch

The second of these two commits seems to be a duplicate of #232 ?

I've never used S3, so can't test this myself, and I'd rather have feedback from other users that this still works with all versions of Python, before merging.

lurch avatar Sep 20 '16 09:09 lurch

@lurch - Thanks for your comments. I'm not sure how the second commit got into this PR.

My Py3 patch was based on that one, so they are similar.

Regarding using a regex. My opinion is that a regex is a tool to use when you have nothing else. In this case I know the other format doesn't have a dash in it, so a simple check should suffix. I guess the more correct code would be to use a smarter date parser (would introduce 3rd party dep) or try and format, then in the error handling code try again.

Anyway, it works for me in Python 3 for adding, removing, renaming, and getting file info of both binary and text files, as well as directories. shrug :)

mattharrison avatar Sep 20 '16 11:09 mattharrison

If you can remove the second commit from this PR and force-push, I'd be happy to merge this alternate-datetime PR.

I suspect the second commit snuck into this PR because you've created it from your master branch, rather than the usual practice of PR-ing from an alternate branch.

lurch avatar Sep 20 '16 11:09 lurch