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

Fix versioning #1340

Merged
merged 4 commits into from
Oct 20, 2023
Merged

Fix versioning #1340

merged 4 commits into from
Oct 20, 2023

Conversation

Pandapip1
Copy link
Contributor

When trying to enable versioning, I was surprised to get the following error:

gavin@GAVIN-IDEAPAD-5A75N8AU:/mnt/c/Users/gavin/source/repos/py-s3fs$ s3cmd setversioning s3://gavins3fstesting enable

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions-(FAQ)
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /home/gavin/bin/s3cmd setversioning s3://gavins3fstesting enable
Problem: <class 'NameError: name 'compute_content_md5' is not defined
S3cmd:   2.3.0-dev
python:   3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
environment LANG=en_US.UTF-8

Traceback (most recent call last):
  File "/home/gavin/bin/s3cmd", line 3461, in <module>
    rc = main()
         ^^^^^^
  File "/home/gavin/bin/s3cmd", line 3358, in main
    rc = cmd_func(args)
         ^^^^^^^^^^^^^^
  File "/home/gavin/bin/s3cmd", line 2211, in cmd_setversioning
    response = s3.set_versioning(bucket_uri, enabled)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gavin/bin/s3cmdvenv/.venv/lib/python3.11/site-packages/S3/S3.py", line 1091, in set_versioning
    headers['content-md5'] = compute_content_md5(body)
                             ^^^^^^^^^^^^^^^^^^^
NameError: name 'compute_content_md5' is not defined

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions-(FAQ)
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

It looks like a function was renamed and one reference to the old name got left behind. This fixes it.

S3/S3.py Outdated Show resolved Hide resolved
@fviard fviard added this to the 2.4.0 milestone Oct 20, 2023
@fviard fviard merged commit db052e9 into s3tools:master Oct 20, 2023
0 of 7 checks passed
@fviard
Copy link
Contributor

fviard commented Oct 20, 2023

Thank you very much for your PR.
I don't know how I missed that, but it is a good catch.

fyi, I have "squashed" all your commits into a single one for merging your PR into master, as it looks like that the previous commit were simply different attempts without a real added value.
As a recommandation, for future PRs you could do here or in another project, it is usually a good practice to rework your set of commits to have a "clean history" of commits.
By that, I mean only having commit for changes sets that have an historical interest to be separated.
Usually, the cleanup can easily be performed using the "rebase interactive" feature of git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants