Skip to content

Commit

Permalink
Actually it's really simple
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandapip1 authored Sep 27, 2023
1 parent f86ce30 commit c4954e3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions S3/S3.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
try:
# Python 2 support
from base64 import encodestring
except ImportError:
# Python 3.9.0+ support
from base64 import encodebytes as encodestring

import select

Expand Down Expand Up @@ -1094,12 +1088,7 @@ def set_versioning(self, uri, enabled):
body += '<Status>%s</Status>' % status
body += '</VersioningConfiguration>'
debug(u"set_versioning(%s)" % body)
m = md5(encode_to_s3(body))
base64md5 = encodestring(m.digest())
base64md5 = decode_from_s3(base64md5)
if base64md5[-1] == '\n':
base64md5 = base64md5[0:-1]
headers['content-md5'] = decode_from_s3(base64md5)
headers['content-md5'] = generate_content_md5(body)

request = self.create_request("BUCKET_CREATE", uri = uri,
headers = headers, body = body,
Expand Down

0 comments on commit c4954e3

Please sign in to comment.