s3cmd icon indicating copy to clipboard operation
s3cmd copied to clipboard

Fixes #1361 and #1027 - update to python 3.2+ API (existing code calls removed API)

Open ms-jpq opened this issue 1 year ago • 2 comments

Fixes:

  • https://github.com/s3tools/s3cmd/issues/1361
  • https://github.com/s3tools/s3cmd/issues/1027

Should be OK to replace the removed API call, since the replacement was added in python 3.2.

https://docs.python.org/3/library/configparser.html

ms-jpq avatar Feb 16 '24 23:02 ms-jpq

Should be OK to replace the removed API call, since the replacement was added in python 3.2.

Wouldn't that break Python 2.x support?

I still see tons of legacy Python 2 fallback code all over the place in s3cmd's code. IMHO removing Python 2 support should be done in a more organized fashion (aka all at once, then bump the major version) rather than a tidbit here or there and breaking things for people that still expect Python 2 support to work as the documentation suggests: "S3cmd requires Python 2.6 or newer." (quote from master readme.md). [Note: I use 3.12, but I know how it is when projects/ packages break backwards compatibility for no particular reasons. ]

TurtleWilly avatar Apr 14 '24 00:04 TurtleWilly

Should be OK to replace the removed API call, since the replacement was added in python 3.2.

Wouldn't that break Python 2.x support?

I still see tons of legacy Python 2 fallback code all over the place in s3cmd's code. IMHO removing Python 2 support should be done in a more organized fashion (aka all at once, then bump the major version) rather than a tidbit here or there and breaking things for people that still expect Python 2 support to work as the documentation suggests: "S3cmd requires Python 2.6 or newer." (quote from master readme.md). [Note: I use 3.12, but I know how it is when projects/ packages break backwards compatibility for no particular reasons. ]

I agree with you this will break code for people using python2.X

though if nothing is done, it will break code for people using python3.12+ so either end it will break someone's code.

So far python2.7 has been deprecated in 2008, and reached its end-of-life in 2020. I think it's time to move forward. Users with the strong need to support python2 can stay on current release of s3cmd.

I believe things should be done in this order:

  1. remove the mention "requires python2.6" from the README
  2. update the code to use config.read_file()

Later on more changes could be added to remove python2 support.

lavigne958 avatar Apr 16 '24 22:04 lavigne958