summaryrefslogtreecommitdiffstats
path: root/contrib/python/botocore
diff options
context:
space:
mode:
authormaxim-yurchuk <[email protected]>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <[email protected]>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/botocore
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/botocore')
-rw-r--r--contrib/python/botocore/py2/.yandex_meta/yamaker.yaml9
-rw-r--r--contrib/python/botocore/py2/patches/01-unvendor-six.patch55
-rw-r--r--contrib/python/botocore/py2/patches/02-fix-for-arcadia.patch192
-rw-r--r--contrib/python/botocore/py2/patches/03-extended-listings.patch192
-rw-r--r--contrib/python/botocore/py3/.yandex_meta/yamaker.yaml9
-rw-r--r--contrib/python/botocore/py3/patches/01-unvendor-six.patch5
-rw-r--r--contrib/python/botocore/py3/patches/02-fix-for-arcadia.patch203
-rw-r--r--contrib/python/botocore/py3/patches/03-extended-listings.patch180
-rw-r--r--contrib/python/botocore/py3/patches/04-add-patch-method.patch135
-rw-r--r--contrib/python/botocore/py3/patches/05-update-patch-method.patch42
10 files changed, 1022 insertions, 0 deletions
diff --git a/contrib/python/botocore/py2/.yandex_meta/yamaker.yaml b/contrib/python/botocore/py2/.yandex_meta/yamaker.yaml
new file mode 100644
index 00000000000..56a8a188a4d
--- /dev/null
+++ b/contrib/python/botocore/py2/.yandex_meta/yamaker.yaml
@@ -0,0 +1,9 @@
+requirements:
+ - certifi
+ - six
+ - library/python/resource
+exclude:
+ - botocore/vendored/six.py
+ - tests/*
+keep:
+ - tests/SQS-119.py
diff --git a/contrib/python/botocore/py2/patches/01-unvendor-six.patch b/contrib/python/botocore/py2/patches/01-unvendor-six.patch
new file mode 100644
index 00000000000..cddba72a025
--- /dev/null
+++ b/contrib/python/botocore/py2/patches/01-unvendor-six.patch
@@ -0,0 +1,55 @@
+--- contrib/python/botocore/py2/botocore/compat.py (index)
++++ contrib/python/botocore/py2/botocore/compat.py (working tree)
+@@ -22,7 +22,7 @@ import shlex
+ import os
+ from math import floor
+
+-from botocore.vendored import six
++import six
+ from botocore.exceptions import MD5UnavailableError
+ from dateutil.tz import tzlocal
+ from urllib3 import exceptions
+@@ -31,7 +31,7 @@ logger = logging.getLogger(__name__)
+
+
+ if six.PY3:
+- from botocore.vendored.six.moves import http_client
++ from six.moves import http_client
+
+ class HTTPHeaders(http_client.HTTPMessage):
+ pass
+--- contrib/python/botocore/py2/botocore/endpoint.py (index)
++++ contrib/python/botocore/py2/botocore/endpoint.py (working tree)
+@@ -17,7 +17,7 @@ import logging
+ import time
+ import threading
+
+-from botocore.vendored import six
++from botocore.compat import six
+
+ from botocore.awsrequest import create_request_object
+ from botocore.exceptions import HTTPClientError
+--- contrib/python/botocore/py2/botocore/httpsession.py (index)
++++ contrib/python/botocore/py2/botocore/httpsession.py (working tree)
+@@ -20,8 +20,8 @@ except ImportError:
+ from urllib3.util.ssl_ import SSLContext
+
+ import botocore.awsrequest
+-from botocore.vendored import six
+-from botocore.vendored.six.moves.urllib_parse import unquote
++from botocore.compat import six
++from six.moves.urllib_parse import unquote
+ from botocore.compat import filter_ssl_warnings, urlparse
+ from botocore.exceptions import (
+ ConnectionClosedError, EndpointConnectionError, HTTPClientError,
+--- contrib/python/botocore/py2/botocore/utils.py (index)
++++ contrib/python/botocore/py2/botocore/utils.py (working tree)
+@@ -35,7 +35,7 @@ from botocore.compat import (
+ json, quote, zip_longest, urlsplit, urlunsplit, OrderedDict,
+ six, urlparse, get_tzinfo_options, get_md5, MD5_AVAILABLE
+ )
+-from botocore.vendored.six.moves.urllib.request import getproxies, proxy_bypass
++from six.moves.urllib.request import getproxies, proxy_bypass
+ from botocore.exceptions import (
+ InvalidExpressionError, ConfigNotFound, InvalidDNSNameError, ClientError,
+ MetadataRetrievalError, EndpointConnectionError, ReadTimeoutError,
diff --git a/contrib/python/botocore/py2/patches/02-fix-for-arcadia.patch b/contrib/python/botocore/py2/patches/02-fix-for-arcadia.patch
new file mode 100644
index 00000000000..55fa553fe1b
--- /dev/null
+++ b/contrib/python/botocore/py2/patches/02-fix-for-arcadia.patch
@@ -0,0 +1,192 @@
+--- contrib/python/botocore/py2/botocore/data/endpoints.json (index)
++++ contrib/python/botocore/py2/botocore/data/endpoints.json (working tree)
+@@ -10656,6 +10656,46 @@
+ }
+ }
+ }
++ }, {
++ "defaults" : {
++ "hostname" : "{service}.{region}.{dnsSuffix}",
++ "protocols" : [ "https" ],
++ "signatureVersions" : [ "v4" ]
++ },
++ "dnsSuffix" : "yandex.net",
++ "partition" : "yandex",
++ "partitionName" : "Yandex",
++ "regions" : {
++ "yandex" : {
++ "description" : "Yandex"
++ }
++ },
++ "services" : {
++ "s3" : {
++ "defaults" : {
++ "protocols" : [ "http", "https" ],
++ "signatureVersions" : [ "s3", "s3v4" ]
++ },
++ "endpoints" : {
++ "yandex" : {
++ "hostname" : "s3.mds.yandex.net"
++ },
++ "yandex-test" : {
++ "hostname" : "s3.mdst.yandex.net"
++ }
++ }
++ },
++ "sqs" : {
++ "defaults" : {
++ "protocols" : [ "http" ]
++ },
++ "endpoints" : {
++ "yandex" : {
++ "hostname": "sqs.yandex.net:8771"
++ }
++ }
++ }
++ }
+ } ],
+ "version" : 3
+ }
+\ No newline at end of file
+--- contrib/python/botocore/py2/botocore/__init__.py (index)
++++ contrib/python/botocore/py2/botocore/__init__.py (working tree)
+@@ -59,7 +59,7 @@ _xform_cache = {
+ # individual case.
+ ScalarTypes = ('string', 'integer', 'boolean', 'timestamp', 'float', 'double')
+
+-BOTOCORE_ROOT = os.path.dirname(os.path.abspath(__file__))
++BOTOCORE_ROOT = os.path.dirname(__file__)
+
+
+ # Used to specify anonymous (unsigned) request signature
+--- contrib/python/botocore/py2/botocore/configprovider.py (index)
++++ contrib/python/botocore/py2/botocore/configprovider.py (working tree)
+@@ -49,7 +49,7 @@ logger = logging.getLogger(__name__)
+ BOTOCORE_DEFAUT_SESSION_VARIABLES = {
+ # logical: config_file, env_var, default_value, conversion_func
+ 'profile': (None, ['AWS_DEFAULT_PROFILE', 'AWS_PROFILE'], None, None),
+- 'region': ('region', 'AWS_DEFAULT_REGION', None, None),
++ 'region': ('region', 'AWS_DEFAULT_REGION', 'yandex', None),
+ 'data_path': ('data_path', 'AWS_DATA_PATH', None, None),
+ 'config_file': (None, 'AWS_CONFIG_FILE', '~/.aws/config', None),
+ 'ca_bundle': ('ca_bundle', 'AWS_CA_BUNDLE', None, None),
+--- contrib/python/botocore/py2/botocore/loaders.py (index)
++++ contrib/python/botocore/py2/botocore/loaders.py (working tree)
+@@ -101,15 +101,19 @@ information that doesn't quite fit in the original models, but is still needed
+ for the sdk. For instance, additional operation parameters might be added here
+ which don't represent the actual service api.
+ """
++import collections
+ import os
+ import logging
+
+ from botocore import BOTOCORE_ROOT
+ from botocore.compat import json
++from botocore.compat import six
+ from botocore.compat import OrderedDict
+ from botocore.exceptions import DataNotFoundError, UnknownServiceError
+ from botocore.utils import deep_merge
+
++from library.python import resource
++
+
+ logger = logging.getLogger(__name__)
+
+@@ -175,6 +179,51 @@ class JSONFileLoader(object):
+ return json.loads(payload, object_pairs_hook=OrderedDict)
+
+
++# SQS-119
++class HybridJsonLoader(JSONFileLoader):
++
++ type_data_cache = collections.defaultdict(lambda: collections.defaultdict(set))
++
++ arcadia_resources_path = (
++ 'contrib/python/awscli/awscli/data/',
++ 'contrib/python/boto3/py2/boto3/data/',
++ 'contrib/python/botocore/py2/botocore/data/',
++ )
++
++ @classmethod
++ def collect_service_data(cls):
++ if cls.type_data_cache:
++ return
++
++ for res in resource.resfs_files():
++ res = six.ensure_str(res)
++ if res.startswith(cls.arcadia_resources_path):
++ splitted_path = res.split('/data/')[1].split('/')
++ if len(splitted_path) >= 3:
++ service_name, version, type_name = splitted_path[:3]
++ type_name = type_name.replace('.json', '')
++ cls.type_data_cache[type_name][service_name].add(version)
++
++ @classmethod
++ def path_in_arcadia_resources(cls, file_path):
++ for prefix in cls.arcadia_resources_path:
++ path = '{}{}.json'.format(prefix, file_path)
++ if path in resource.resfs_files():
++ return path
++ return
++
++ def exists(self, file_path):
++ if self.path_in_arcadia_resources(file_path):
++ return True
++ return super(HybridJsonLoader, self).exists(file_path)
++
++ def load_file(self, file_path):
++ path = self.path_in_arcadia_resources(file_path)
++ if path:
++ return json.loads(resource.resfs_read(path).decode(encoding='utf-8'))
++ return super(HybridJsonLoader, self).load_file(file_path)
++
++
+ def create_loader(search_path_string=None):
+ """Create a Loader class.
+
+@@ -208,7 +257,7 @@ class Loader(object):
+ convenience method over ``load_data`` and ``determine_latest_version``.
+
+ """
+- FILE_LOADER_CLASS = JSONFileLoader
++ FILE_LOADER_CLASS = HybridJsonLoader
+ # The included models in botocore/data/ that we ship with botocore.
+ BUILTIN_DATA_PATH = os.path.join(BOTOCORE_ROOT, 'data')
+ # For convenience we automatically add ~/.aws/models to the data path.
+@@ -284,6 +333,11 @@ class Loader(object):
+ if self.file_loader.exists(full_load_path):
+ services.add(service_name)
+ break
++
++ # SQS-119
++ HybridJsonLoader.collect_service_data()
++ services = services.union(HybridJsonLoader.type_data_cache[type_name].keys())
++
+ return sorted(services)
+
+ @instance_cache
+@@ -335,6 +389,11 @@ class Loader(object):
+ # to the type_name passed in.
+ if self.file_loader.exists(full_path):
+ known_api_versions.add(dirname)
++
++ # SQS-119
++ HybridJsonLoader.collect_service_data()
++ known_api_versions = known_api_versions.union(HybridJsonLoader.type_data_cache[type_name][service_name])
++
+ if not known_api_versions:
+ raise DataNotFoundError(data_path=service_name)
+ return sorted(known_api_versions)
+@@ -420,6 +479,12 @@ class Loader(object):
+ found = self.file_loader.load_file(possible_path)
+ if found is not None:
+ return found
++
++ # SQS-119
++ found_by_arcadia_loader = self.file_loader.load_file(name)
++ if found_by_arcadia_loader is not None:
++ return found_by_arcadia_loader
++
+ # We didn't find anything that matched on any path.
+ raise DataNotFoundError(data_path=name)
+
diff --git a/contrib/python/botocore/py2/patches/03-extended-listings.patch b/contrib/python/botocore/py2/patches/03-extended-listings.patch
new file mode 100644
index 00000000000..acc45978459
--- /dev/null
+++ b/contrib/python/botocore/py2/patches/03-extended-listings.patch
@@ -0,0 +1,192 @@
+commit cc02b99f18408f40978b56abfd8e5e9b2c2492d7 (HEAD -> s3tests-v1ext, arcadia/users/vitaliff/s3tests-v1ext)
+author: vitaliff
+date: 2021-10-27T00:34:16+03:00
+
+ Add ListObjectsV1Ext into boto3 and add a test for it
+
+--- contrib/python/botocore/py2/botocore/data/s3/2006-03-01/service-2.json (73e85ed9c4be248886f10db6b7d83f27d446916c)
++++ contrib/python/botocore/py2/botocore/data/s3/2006-03-01/service-2.json (cc02b99f18408f40978b56abfd8e5e9b2c2492d7)
+@@ -716,6 +716,19 @@
+ ],
+ "documentation":"<p>Returns some or all (up to 1,000) of the objects in a bucket with each request. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. A <code>200 OK</code> response can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately. Objects are returned sorted in an ascending order of the respective key names in the list. For more information about listing objects, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html\">Listing object keys programmatically</a> </p> <p>To use this operation, you must have READ access to the bucket.</p> <p>To use this action in an AWS Identity and Access Management (IAM) policy, you must have permissions to perform the <code>s3:ListBucket</code> action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources\">Permissions Related to Bucket Subresource Operations</a> and <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html\">Managing Access Permissions to Your Amazon S3 Resources</a>.</p> <important> <p>This section describes the latest revision of this action. We recommend that you use this revised API for application development. For backward compatibility, Amazon S3 continues to support the prior version of this API, <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html\">ListObjects</a>.</p> </important> <p>To get a list of your buckets, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html\">ListBuckets</a>.</p> <p>The following operations are related to <code>ListObjectsV2</code>:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html\">GetObject</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html\">PutObject</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html\">CreateBucket</a> </p> </li> </ul>"
+ },
++ "ListObjectsV1Ext":{
++ "name":"ListObjectsV1Ext",
++ "http":{
++ "method":"GET",
++ "requestUri":"/{Bucket}?list-type=ext-v1"
++ },
++ "input":{"shape":"ListObjectsV2Request"},
++ "output":{"shape":"ListObjectsV1ExtOutput"},
++ "errors":[
++ {"shape":"NoSuchBucket"}
++ ],
++ "documentation":"<p>Yandex S3-specific extended listing method. Same as V2, but includes user metadata for each object. The rest of the parameters are exactly the same as in ListObjectsV2.</p>"
++ },
+ "ListParts":{
+ "name":"ListParts",
+ "http":{
+@@ -5990,6 +6003,59 @@
+ }
+ }
+ },
++ "ListObjectsV1ExtOutput":{
++ "type":"structure",
++ "members":{
++ "IsTruncated":{
++ "shape":"IsTruncated",
++ "documentation":"<p>Set to false if all of the results were returned. Set to true if more keys are available to return. If the number of results exceeds that specified by MaxKeys, all of the results might not be returned.</p>"
++ },
++ "Contents":{
++ "shape":"ObjectListV1Ext",
++ "documentation":"<p>Metadata about each object returned.</p>"
++ },
++ "Name":{
++ "shape":"BucketName",
++ "documentation":"<p>The bucket name.</p> <p>When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html\">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p> <p>When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com. When using this action using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html\">Using S3 on Outposts</a> in the <i>Amazon S3 User Guide</i>.</p>"
++ },
++ "Prefix":{
++ "shape":"Prefix",
++ "documentation":"<p> Keys that begin with the indicated prefix.</p>"
++ },
++ "Delimiter":{
++ "shape":"Delimiter",
++ "documentation":"<p>Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the <code>MaxKeys</code> value.</p>"
++ },
++ "MaxKeys":{
++ "shape":"MaxKeys",
++ "documentation":"<p>Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.</p>"
++ },
++ "CommonPrefixes":{
++ "shape":"CommonPrefixList",
++ "documentation":"<p>All of the keys (up to 1,000) rolled up into a common prefix count as a single return when calculating the number of returns.</p> <p>A response can contain <code>CommonPrefixes</code> only if you specify a delimiter.</p> <p> <code>CommonPrefixes</code> contains all (if there are any) keys between <code>Prefix</code> and the next occurrence of the string specified by a delimiter.</p> <p> <code>CommonPrefixes</code> lists keys that act like subdirectories in the directory specified by <code>Prefix</code>.</p> <p>For example, if the prefix is <code>notes/</code> and the delimiter is a slash (<code>/</code>) as in <code>notes/summer/july</code>, the common prefix is <code>notes/summer/</code>. All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. </p>"
++ },
++ "EncodingType":{
++ "shape":"EncodingType",
++ "documentation":"<p>Encoding type used by Amazon S3 to encode object key names in the XML response.</p> <p>If you specify the encoding-type request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements:</p> <p> <code>Delimiter, Prefix, Key,</code> and <code>StartAfter</code>.</p>"
++ },
++ "KeyCount":{
++ "shape":"KeyCount",
++ "documentation":"<p>KeyCount is the number of keys returned with this request. KeyCount will always be less than or equals to MaxKeys field. Say you ask for 50 keys, your result will include less than equals 50 keys </p>"
++ },
++ "ContinuationToken":{
++ "shape":"Token",
++ "documentation":"<p> If ContinuationToken was sent with the request, it is included in the response.</p>"
++ },
++ "NextContinuationToken":{
++ "shape":"NextToken",
++ "documentation":"<p> <code>NextContinuationToken</code> is sent when <code>isTruncated</code> is true, which means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 can be continued with this <code>NextContinuationToken</code>. <code>NextContinuationToken</code> is obfuscated and is not a real key</p>"
++ },
++ "StartAfter":{
++ "shape":"StartAfter",
++ "documentation":"<p>If StartAfter was sent with the request, it is included in the response.</p>"
++ }
++ }
++ },
+ "ListPartsOutput":{
+ "type":"structure",
+ "members":{
+@@ -6158,6 +6224,12 @@
+ "key":{"shape":"MetadataKey"},
+ "value":{"shape":"MetadataValue"}
+ },
++ "MetadataMap":{
++ "type":"map",
++ "flattened":true,
++ "key":{"shape":"MetadataKey","locationName":"Name"},
++ "value":{"shape":"MetadataValue","locationName":"Value"}
++ },
+ "MetadataDirective":{
+ "type":"string",
+ "enum":[
+@@ -6434,6 +6506,40 @@
+ },
+ "documentation":"<p>An object consists of data and its descriptive metadata.</p>"
+ },
++ "ObjectV1Ext":{
++ "type":"structure",
++ "members":{
++ "Key":{
++ "shape":"ObjectKey",
++ "documentation":"<p>The name that you assign to an object. You use the object key to retrieve the object.</p>"
++ },
++ "LastModified":{
++ "shape":"LastModified",
++ "documentation":"<p>Creation date of the object.</p>"
++ },
++ "ETag":{
++ "shape":"ETag",
++ "documentation":"<p>The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below:</p> <ul> <li> <p>Objects created by the PUT Object, POST Object, or Copy operation, or through the AWS Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data.</p> </li> <li> <p>Objects created by the PUT Object, POST Object, or Copy operation, or through the AWS Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data.</p> </li> <li> <p>If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption.</p> </li> </ul>"
++ },
++ "Size":{
++ "shape":"Size",
++ "documentation":"<p>Size in bytes of the object</p>"
++ },
++ "StorageClass":{
++ "shape":"ObjectStorageClass",
++ "documentation":"<p>The class of storage used to store the object.</p>"
++ },
++ "Owner":{
++ "shape":"Owner",
++ "documentation":"<p>The owner of the object</p>"
++ },
++ "Metadata":{
++ "shape":"MetadataMap",
++ "documentation":"<p>User metadata of the object</p>"
++ }
++ },
++ "documentation":"<p>An object consists of data and its descriptive metadata.</p>"
++ },
+ "ObjectAlreadyInActiveTierError":{
+ "type":"structure",
+ "members":{
+@@ -6482,6 +6588,11 @@
+ "member":{"shape":"Object"},
+ "flattened":true
+ },
++ "ObjectListV1Ext":{
++ "type":"list",
++ "member":{"shape":"ObjectV1Ext"},
++ "flattened":true
++ },
+ "ObjectLockConfiguration":{
+ "type":"structure",
+ "members":{
+--- contrib/python/botocore/py2/botocore/handlers.py (73e85ed9c4be248886f10db6b7d83f27d446916c)
++++ contrib/python/botocore/py2/botocore/handlers.py (cc02b99f18408f40978b56abfd8e5e9b2c2492d7)
+@@ -737,6 +737,27 @@ def decode_list_object_v2(parsed, context, **kwargs):
+ )
+
+
++def decode_list_object_v1ext(parsed, context, **kwargs):
++ # From the documentation: If you specify encoding-type request parameter,
++ # Amazon S3 includes this element in the response, and returns encoded key
++ # name values in the following response elements:
++ # Delimiter, Prefix, ContinuationToken, Key, and StartAfter.
++ _decode_list_object(
++ top_level_keys=['Delimiter', 'Prefix', 'StartAfter'],
++ nested_keys=[('Contents', 'Key'), ('CommonPrefixes', 'Prefix')],
++ parsed=parsed,
++ context=context
++ )
++ # lowercase metadata keys
++ if 'Contents' in parsed:
++ for o in parsed['Contents']:
++ if 'Metadata' in o:
++ lcmeta = {}
++ for k in o['Metadata']:
++ lcmeta[k.lower()] = o['Metadata'][k]
++ o['Metadata'] = lcmeta
++
++
+ def decode_list_object_versions(parsed, context, **kwargs):
+ # From the documentation: If you specify encoding-type request parameter,
+ # Amazon S3 includes this element in the response, and returns encoded key
+@@ -1017,6 +1038,7 @@ BUILTIN_HANDLERS = [
+ ('before-parameter-build.glacier', inject_account_id),
+ ('after-call.s3.ListObjects', decode_list_object),
+ ('after-call.s3.ListObjectsV2', decode_list_object_v2),
++ ('after-call.s3.ListObjectsV1Ext', decode_list_object_v1ext),
+ ('after-call.s3.ListObjectVersions', decode_list_object_versions),
+
+ # Cloudsearchdomain search operation will be sent by HTTP POST
diff --git a/contrib/python/botocore/py3/.yandex_meta/yamaker.yaml b/contrib/python/botocore/py3/.yandex_meta/yamaker.yaml
new file mode 100644
index 00000000000..56a8a188a4d
--- /dev/null
+++ b/contrib/python/botocore/py3/.yandex_meta/yamaker.yaml
@@ -0,0 +1,9 @@
+requirements:
+ - certifi
+ - six
+ - library/python/resource
+exclude:
+ - botocore/vendored/six.py
+ - tests/*
+keep:
+ - tests/SQS-119.py
diff --git a/contrib/python/botocore/py3/patches/01-unvendor-six.patch b/contrib/python/botocore/py3/patches/01-unvendor-six.patch
new file mode 100644
index 00000000000..3d9848e3539
--- /dev/null
+++ b/contrib/python/botocore/py3/patches/01-unvendor-six.patch
@@ -0,0 +1,5 @@
+--- contrib/python/botocore/py3/botocore/compat.py (index)
++++ contrib/python/botocore/py3/botocore/compat.py (working tree)
+@@ -28,1 +28,1 @@ import shlex
+-from botocore.vendored import six
++import six
diff --git a/contrib/python/botocore/py3/patches/02-fix-for-arcadia.patch b/contrib/python/botocore/py3/patches/02-fix-for-arcadia.patch
new file mode 100644
index 00000000000..7a10b07030a
--- /dev/null
+++ b/contrib/python/botocore/py3/patches/02-fix-for-arcadia.patch
@@ -0,0 +1,203 @@
+--- contrib/python/botocore/py3/botocore/data/endpoints.json (index)
++++ contrib/python/botocore/py3/botocore/data/endpoints.json (working tree)
+@@ -21165,6 +21165,46 @@
+ "regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$",
+ "regions" : { },
+ "services" : { }
++ }, {
++ "defaults" : {
++ "hostname" : "{service}.{region}.{dnsSuffix}",
++ "protocols" : [ "https" ],
++ "signatureVersions" : [ "v4" ]
++ },
++ "dnsSuffix" : "yandex.net",
++ "partition" : "yandex",
++ "partitionName" : "Yandex",
++ "regions" : {
++ "yandex" : {
++ "description" : "Yandex"
++ }
++ },
++ "services" : {
++ "s3" : {
++ "defaults" : {
++ "protocols" : [ "http", "https" ],
++ "signatureVersions" : [ "s3", "s3v4" ]
++ },
++ "endpoints" : {
++ "yandex" : {
++ "hostname" : "s3.mds.yandex.net"
++ },
++ "yandex-test" : {
++ "hostname" : "s3.mdst.yandex.net"
++ }
++ }
++ },
++ "sqs" : {
++ "defaults" : {
++ "protocols" : [ "http" ]
++ },
++ "endpoints" : {
++ "yandex" : {
++ "hostname": "sqs.yandex.net:8771"
++ }
++ }
++ }
++ }
+ } ],
+ "version" : 3
+ }
+\ No newline at end of file
+--- contrib/python/botocore/py3/botocore/__init__.py (index)
++++ contrib/python/botocore/py3/botocore/__init__.py (working tree)
+@@ -64,1 +64,1 @@ _xform_cache = {
+-BOTOCORE_ROOT = os.path.dirname(os.path.abspath(__file__))
++BOTOCORE_ROOT = os.path.dirname(__file__)
+--- contrib/python/botocore/py3/botocore/configprovider.py (index)
++++ contrib/python/botocore/py3/botocore/configprovider.py (working tree)
+@@ -52,1 +52,1 @@ logger = logging.getLogger(__name__)
+- 'region': ('region', 'AWS_DEFAULT_REGION', None, None),
++ 'region': ('region', 'AWS_DEFAULT_REGION', 'yandex', None),
+--- contrib/python/botocore/py3/botocore/loaders.py (index)
++++ contrib/python/botocore/py3/botocore/loaders.py (working tree)
+@@ -101,14 +101,17 @@ information that doesn't quite fit in the original models, but is still needed
+ for the sdk. For instance, additional operation parameters might be added here
+ which don't represent the actual service api.
+ """
++import collections
+ import logging
+ import os
+
+ from botocore import BOTOCORE_ROOT
+-from botocore.compat import HAS_GZIP, OrderedDict, json
++from botocore.compat import HAS_GZIP, OrderedDict, json, six
+ from botocore.exceptions import DataNotFoundError, UnknownServiceError
+ from botocore.utils import deep_merge
+
++from library.python import resource
++
+ _JSON_OPEN_METHODS = {
+ '.json': open,
+ }
+@@ -197,6 +200,67 @@ class JSONFileLoader(object):
+ return None
+
+
++# SQS-119
++class HybridJsonLoader(JSONFileLoader):
++
++ type_data_cache = collections.defaultdict(lambda: collections.defaultdict(set))
++
++ arcadia_resources_path = (
++ 'contrib/python/awscli/awscli/data/',
++ 'contrib/python/boto3/py3/boto3/data/',
++ 'contrib/python/botocore/py3/botocore/data/',
++ )
++
++ @classmethod
++ def collect_service_data(cls):
++ if cls.type_data_cache:
++ return
++
++ for res in resource.resfs_files():
++ res = six.ensure_str(res)
++ if res.startswith(cls.arcadia_resources_path):
++ splitted_path = res.split('/data/')[1].split('/')
++ if len(splitted_path) >= 3:
++ service_name, version, type_name = splitted_path[:3]
++ type_name = type_name.replace('.json.gz', '').replace('.json', '')
++ cls.type_data_cache[type_name][service_name].add(version)
++
++ @classmethod
++ def read_from_resources(cls, file_path):
++ for ext in _JSON_OPEN_METHODS:
++ for prefix in cls.arcadia_resources_path:
++ path = f'{prefix}{file_path}{ext}'
++ data = resource.resfs_read(path)
++ if data:
++ return path, ext, data
++ return
++
++ def exists(self, file_path):
++ if self.read_from_resources(file_path):
++ return True
++ return super(HybridJsonLoader, self).exists(file_path)
++
++ def _load_resource(self, full_path, ext, data):
++ # By default the file will be opened with locale encoding on Python 3.
++ # We specify "utf8" here to ensure the correct behavior.
++ if ext == ".json":
++ payload = data.decode('utf-8')
++ elif ext == ".json.gz":
++ import io
++ with gzip_open(io.BytesIO(data)) as fp:
++ payload = fp.read().decode('utf-8')
++ else:
++ raise ValueError(f"Unknown extension {ext}")
++
++ logger.debug("Loading JSON file: %s", full_path)
++ return json.loads(payload, object_pairs_hook=OrderedDict)
++
++ def load_file(self, file_path):
++ if load_args := self.read_from_resources(file_path):
++ return self._load_resource(*load_args)
++ return super(HybridJsonLoader, self).load_file(file_path)
++
++
+ def create_loader(search_path_string=None):
+ """Create a Loader class.
+
+@@ -231,7 +279,7 @@ class Loader(object):
+
+ """
+
+- FILE_LOADER_CLASS = JSONFileLoader
++ FILE_LOADER_CLASS = HybridJsonLoader
+ # The included models in botocore/data/ that we ship with botocore.
+ BUILTIN_DATA_PATH = os.path.join(BOTOCORE_ROOT, 'data')
+ # For convenience we automatically add ~/.aws/models to the data path.
+@@ -316,6 +364,11 @@ class Loader(object):
+ if self.file_loader.exists(full_load_path):
+ services.add(service_name)
+ break
++
++ # SQS-119
++ HybridJsonLoader.collect_service_data()
++ services = services.union(HybridJsonLoader.type_data_cache[type_name].keys())
++
+ return sorted(services)
+
+ @instance_cache
+@@ -367,6 +420,11 @@ class Loader(object):
+ # to the type_name passed in.
+ if self.file_loader.exists(full_path):
+ known_api_versions.add(dirname)
++
++ # SQS-119
++ HybridJsonLoader.collect_service_data()
++ known_api_versions = known_api_versions.union(HybridJsonLoader.type_data_cache[type_name][service_name])
++
+ if not known_api_versions:
+ raise DataNotFoundError(data_path=service_name)
+ return sorted(known_api_versions)
+@@ -449,6 +507,11 @@ class Loader(object):
+ if found is not None:
+ return found, possible_path
+
++ # SQS-119
++ found_by_arcadia_loader = self.file_loader.load_file(name)
++ if found_by_arcadia_loader is not None:
++ return found_by_arcadia_loader, None
++
+ # We didn't find anything that matched on any path.
+ raise DataNotFoundError(data_path=name)
+
+@@ -499,6 +562,8 @@ class Loader:
+
+ :return: Whether the given path is within the package's data directory.
+ """
++ if path is None:
++ return True
+ path = os.path.expanduser(os.path.expandvars(path))
+ return path.startswith(self.BUILTIN_DATA_PATH)
+
diff --git a/contrib/python/botocore/py3/patches/03-extended-listings.patch b/contrib/python/botocore/py3/patches/03-extended-listings.patch
new file mode 100644
index 00000000000..d0a2e03e702
--- /dev/null
+++ b/contrib/python/botocore/py3/patches/03-extended-listings.patch
@@ -0,0 +1,180 @@
+commit cc02b99f18408f40978b56abfd8e5e9b2c2492d7 (HEAD -> s3tests-v1ext, arcadia/users/vitaliff/s3tests-v1ext)
+author: vitaliff
+date: 2021-10-27T00:34:16+03:00
+
+ Add ListObjectsV1Ext into boto3 and add a test for it
+
+--- contrib/python/botocore/py3/botocore/data/s3/2006-03-01/service-2.json (73e85ed9c4be248886f10db6b7d83f27d446916c)
++++ contrib/python/botocore/py3/botocore/data/s3/2006-03-01/service-2.json (cc02b99f18408f40978b56abfd8e5e9b2c2492d7)
+@@ -746,2 +746,15 @@
+ },
++ "ListObjectsV1Ext":{
++ "name":"ListObjectsV1Ext",
++ "http":{
++ "method":"GET",
++ "requestUri":"/{Bucket}?list-type=ext-v1"
++ },
++ "input":{"shape":"ListObjectsV2Request"},
++ "output":{"shape":"ListObjectsV1ExtOutput"},
++ "errors":[
++ {"shape":"NoSuchBucket"}
++ ],
++ "documentation":"<p>Yandex S3-specific extended listing method. Same as V2, but includes user metadata for each object. The rest of the parameters are exactly the same as in ListObjectsV2.</p>"
++ },
+ "ListParts":{
+@@ -6516,6 +6529,59 @@
+ }
+ }
+ },
++ "ListObjectsV1ExtOutput":{
++ "type":"structure",
++ "members":{
++ "IsTruncated":{
++ "shape":"IsTruncated",
++ "documentation":"<p>Set to false if all of the results were returned. Set to true if more keys are available to return. If the number of results exceeds that specified by MaxKeys, all of the results might not be returned.</p>"
++ },
++ "Contents":{
++ "shape":"ObjectListV1Ext",
++ "documentation":"<p>Metadata about each object returned.</p>"
++ },
++ "Name":{
++ "shape":"BucketName",
++ "documentation":"<p>The bucket name.</p> <p>When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html\">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p> <p>When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com. When using this action using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html\">Using S3 on Outposts</a> in the <i>Amazon S3 User Guide</i>.</p>"
++ },
++ "Prefix":{
++ "shape":"Prefix",
++ "documentation":"<p> Keys that begin with the indicated prefix.</p>"
++ },
++ "Delimiter":{
++ "shape":"Delimiter",
++ "documentation":"<p>Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the <code>MaxKeys</code> value.</p>"
++ },
++ "MaxKeys":{
++ "shape":"MaxKeys",
++ "documentation":"<p>Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.</p>"
++ },
++ "CommonPrefixes":{
++ "shape":"CommonPrefixList",
++ "documentation":"<p>All of the keys (up to 1,000) rolled up into a common prefix count as a single return when calculating the number of returns.</p> <p>A response can contain <code>CommonPrefixes</code> only if you specify a delimiter.</p> <p> <code>CommonPrefixes</code> contains all (if there are any) keys between <code>Prefix</code> and the next occurrence of the string specified by a delimiter.</p> <p> <code>CommonPrefixes</code> lists keys that act like subdirectories in the directory specified by <code>Prefix</code>.</p> <p>For example, if the prefix is <code>notes/</code> and the delimiter is a slash (<code>/</code>) as in <code>notes/summer/july</code>, the common prefix is <code>notes/summer/</code>. All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. </p>"
++ },
++ "EncodingType":{
++ "shape":"EncodingType",
++ "documentation":"<p>Encoding type used by Amazon S3 to encode object key names in the XML response.</p> <p>If you specify the encoding-type request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements:</p> <p> <code>Delimiter, Prefix, Key,</code> and <code>StartAfter</code>.</p>"
++ },
++ "KeyCount":{
++ "shape":"KeyCount",
++ "documentation":"<p>KeyCount is the number of keys returned with this request. KeyCount will always be less than or equals to MaxKeys field. Say you ask for 50 keys, your result will include less than equals 50 keys </p>"
++ },
++ "ContinuationToken":{
++ "shape":"Token",
++ "documentation":"<p> If ContinuationToken was sent with the request, it is included in the response.</p>"
++ },
++ "NextContinuationToken":{
++ "shape":"NextToken",
++ "documentation":"<p> <code>NextContinuationToken</code> is sent when <code>isTruncated</code> is true, which means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 can be continued with this <code>NextContinuationToken</code>. <code>NextContinuationToken</code> is obfuscated and is not a real key</p>"
++ },
++ "StartAfter":{
++ "shape":"StartAfter",
++ "documentation":"<p>If StartAfter was sent with the request, it is included in the response.</p>"
++ }
++ }
++ },
+ "ListPartsOutput":{
+ "type":"structure",
+ "members":{
+@@ -6706,6 +6772,12 @@
+ "key":{"shape":"MetadataKey"},
+ "value":{"shape":"MetadataValue"}
+ },
++ "MetadataMap":{
++ "type":"map",
++ "flattened":true,
++ "key":{"shape":"MetadataKey","locationName":"Name"},
++ "value":{"shape":"MetadataValue","locationName":"Value"}
++ },
+ "MetadataDirective":{
+ "type":"string",
+ "enum":[
+@@ -7010,6 +7082,40 @@
+ },
+ "documentation":"<p>An object consists of data and its descriptive metadata.</p>"
+ },
++ "ObjectV1Ext":{
++ "type":"structure",
++ "members":{
++ "Key":{
++ "shape":"ObjectKey",
++ "documentation":"<p>The name that you assign to an object. You use the object key to retrieve the object.</p>"
++ },
++ "LastModified":{
++ "shape":"LastModified",
++ "documentation":"<p>Creation date of the object.</p>"
++ },
++ "ETag":{
++ "shape":"ETag",
++ "documentation":"<p>The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below:</p> <ul> <li> <p>Objects created by the PUT Object, POST Object, or Copy operation, or through the AWS Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data.</p> </li> <li> <p>Objects created by the PUT Object, POST Object, or Copy operation, or through the AWS Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data.</p> </li> <li> <p>If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption.</p> </li> </ul>"
++ },
++ "Size":{
++ "shape":"Size",
++ "documentation":"<p>Size in bytes of the object</p>"
++ },
++ "StorageClass":{
++ "shape":"ObjectStorageClass",
++ "documentation":"<p>The class of storage used to store the object.</p>"
++ },
++ "Owner":{
++ "shape":"Owner",
++ "documentation":"<p>The owner of the object</p>"
++ },
++ "Metadata":{
++ "shape":"MetadataMap",
++ "documentation":"<p>User metadata of the object</p>"
++ }
++ },
++ "documentation":"<p>An object consists of data and its descriptive metadata.</p>"
++ },
+ "ObjectAlreadyInActiveTierError":{
+ "type":"structure",
+ "members":{
+@@ -7072,6 +7178,11 @@
+ "member":{"shape":"Object"},
+ "flattened":true
+ },
++ "ObjectListV1Ext":{
++ "type":"list",
++ "member":{"shape":"ObjectV1Ext"},
++ "flattened":true
++ },
+ "ObjectLockConfiguration":{
+ "type":"structure",
+ "members":{
+--- contrib/python/botocore/py3/botocore/handlers.py (73e85ed9c4be248886f10db6b7d83f27d446916c)
++++ contrib/python/botocore/py3/botocore/handlers.py (cc02b99f18408f40978b56abfd8e5e9b2c2492d7)
+@@ -807,2 +807,23 @@ def decode_list_object_v2(parsed, context, **kwargs):
+
++def decode_list_object_v1ext(parsed, context, **kwargs):
++ # From the documentation: If you specify encoding-type request parameter,
++ # Amazon S3 includes this element in the response, and returns encoded key
++ # name values in the following response elements:
++ # Delimiter, Prefix, ContinuationToken, Key, and StartAfter.
++ _decode_list_object(
++ top_level_keys=['Delimiter', 'Prefix', 'StartAfter'],
++ nested_keys=[('Contents', 'Key'), ('CommonPrefixes', 'Prefix')],
++ parsed=parsed,
++ context=context
++ )
++ # lowercase metadata keys
++ if 'Contents' in parsed:
++ for o in parsed['Contents']:
++ if 'Metadata' in o:
++ lcmeta = {}
++ for k in o['Metadata']:
++ lcmeta[k.lower()] = o['Metadata'][k]
++ o['Metadata'] = lcmeta
++
++
+ def decode_list_object_versions(parsed, context, **kwargs):
+@@ -1240,2 +1261,3 @@ BUILTIN_HANDLERS = [
+ ('after-call.s3.ListObjectsV2', decode_list_object_v2),
++ ('after-call.s3.ListObjectsV1Ext', decode_list_object_v1ext),
+ ('after-call.s3.ListObjectVersions', decode_list_object_versions),
diff --git a/contrib/python/botocore/py3/patches/04-add-patch-method.patch b/contrib/python/botocore/py3/patches/04-add-patch-method.patch
new file mode 100644
index 00000000000..8ee4d066ce3
--- /dev/null
+++ b/contrib/python/botocore/py3/patches/04-add-patch-method.patch
@@ -0,0 +1,135 @@
+--- contrib/python/botocore/py3/botocore/data/s3/2006-03-01/service-2.json (e035e6a001bce129cf5b55dd3b909de5cff9b0ab)
++++ contrib/python/botocore/py3/botocore/data/s3/2006-03-01/service-2.json (cf1d3bd37058ca841449300119cddcb6fee50e49)
+@@ -1032,6 +1032,21 @@
+ "requestChecksumRequired":false
+ }
+ },
++ "PatchObject":{
++ "name":"PatchObject",
++ "http":{
++ "method":"PATCH",
++ "requestUri":"/{Bucket}/{Key+}"
++ },
++ "input":{"shape":"PatchObjectRequest"},
++ "output":{"shape":"PatchObjectOutput"},
++ "documentationUrl":"",
++ "documentation":"",
++ "httpChecksum":{
++ "requestAlgorithmMember":"ChecksumAlgorithm",
++ "requestChecksumRequired":false
++ }
++ },
+ "PutObjectAcl":{
+ "name":"PutObjectAcl",
+ "http":{
+@@ -9105,6 +9120,80 @@
+ },
+ "payload":"Body"
+ },
++ "PatchObjectOutput":{
++ "type":"structure",
++ "members":{
++ "ETag":{"shape":"ETag"},
++ "LastModified":{"shape":"LastModified"}
++ }
++ },
++ "PatchAppendPartSize":{"type": "integer"},
++ "PatchObjectRequest":{
++ "type":"structure",
++ "required":[
++ "Bucket",
++ "Key",
++ "ContentRange"
++ ],
++ "members":{
++ "Body":{
++ "shape":"Body",
++ "streaming":true
++ },
++ "Bucket":{
++ "shape":"BucketName",
++ "contextParam":{"name":"Bucket"},
++ "location":"uri",
++ "locationName":"Bucket"
++ },
++ "ContentLength":{
++ "shape":"ContentLength",
++ "location":"header",
++ "locationName":"Content-Length"
++ },
++ "ContentMD5":{
++ "shape":"ContentMD5",
++ "location":"header",
++ "locationName":"Content-MD5"
++ },
++ "ContentRange":{
++ "shape":"ContentRange",
++ "location":"header",
++ "locationName":"Content-Range"
++ },
++ "IfMatch":{
++ "shape":"IfMatch",
++ "location":"header",
++ "locationName":"If-Match"
++ },
++ "IfModifiedSince":{
++ "shape":"IfModifiedSince",
++ "location":"header",
++ "locationName":"If-Modified-Since"
++ },
++ "IfNoneMatch":{
++ "shape":"IfNoneMatch",
++ "location":"header",
++ "locationName":"If-None-Match"
++ },
++ "IfUnmodifiedSince":{
++ "shape":"IfUnmodifiedSince",
++ "location":"header",
++ "locationName":"If-Unmodified-Since"
++ },
++ "Key":{
++ "shape":"ObjectKey",
++ "location":"uri",
++ "locationName":"Key"
++ },
++ "PatchAppendPartSize":{
++ "shape":"PatchAppendPartSize",
++ "location":"header",
++ "locationName":"X-Yc-S3-Patch-Append-Part-Size"
++ }
++ },
++ "payload":"Body"
++ },
+ "PutObjectRetentionOutput":{
+ "type":"structure",
+ "members":{
+--- contrib/python/botocore/py3/botocore/handlers.py (e035e6a001bce129cf5b55dd3b909de5cff9b0ab)
++++ contrib/python/botocore/py3/botocore/handlers.py (cf1d3bd37058ca841449300119cddcb6fee50e49)
+@@ -1189,6 +1189,11 @@ BUILTIN_HANDLERS = [
+ convert_body_to_file_like_object,
+ REGISTER_LAST,
+ ),
++ (
++ 'before-parameter-build.s3.PatchObject',
++ convert_body_to_file_like_object,
++ REGISTER_LAST,
++ ),
+ ('creating-client-class', add_generate_presigned_url),
+ ('creating-client-class.s3', add_generate_presigned_post),
+ ('creating-client-class.iot-data', check_openssl_supports_tls_version_1_2),
+@@ -1229,6 +1234,7 @@ BUILTIN_HANDLERS = [
+ ('before-call.glacier', add_glacier_version),
+ ('before-call.apigateway', add_accept_header),
+ ('before-call.s3.PutObject', conditionally_calculate_md5),
++ ('before-call.s3.PatchObject', conditionally_calculate_md5),
+ ('before-call.s3.UploadPart', conditionally_calculate_md5),
+ ('before-call.s3.DeleteObjects', escape_xml_payload),
+ ('before-call.s3.PutBucketLifecycleConfiguration', escape_xml_payload),
+@@ -1257,6 +1263,7 @@ BUILTIN_HANDLERS = [
+ ('before-parameter-build.s3.HeadObject', sse_md5),
+ ('before-parameter-build.s3.GetObject', sse_md5),
+ ('before-parameter-build.s3.PutObject', sse_md5),
++ ('before-parameter-build.s3.PatchObject', sse_md5),
+ ('before-parameter-build.s3.CopyObject', sse_md5),
+ ('before-parameter-build.s3.CopyObject', copy_source_sse_md5),
+ ('before-parameter-build.s3.CreateMultipartUpload', sse_md5),
diff --git a/contrib/python/botocore/py3/patches/05-update-patch-method.patch b/contrib/python/botocore/py3/patches/05-update-patch-method.patch
new file mode 100644
index 00000000000..8a2189b25ce
--- /dev/null
+++ b/contrib/python/botocore/py3/patches/05-update-patch-method.patch
@@ -0,0 +1,42 @@
+--- contrib/python/botocore/py3/botocore/data/s3/2006-03-01/service-2.json (rev 12849850)
++++ contrib/python/botocore/py3/botocore/data/s3/2006-03-01/service-2.json (working copy)
+@@ -9120,14 +9120,20 @@
+ },
+ "payload":"Body"
+ },
+- "PatchObjectOutput":{
++ "PatchAppendPartSize":{"type": "integer"},
++ "PatchedObjectInfo":{
+ "type":"structure",
+ "members":{
+ "ETag":{"shape":"ETag"},
+ "LastModified":{"shape":"LastModified"}
+ }
+ },
+- "PatchAppendPartSize":{"type": "integer"},
++ "PatchObjectOutput":{
++ "type":"structure",
++ "members":{
++ "Object":{"shape":"PatchedObjectInfo"}
++ }
++ },
+ "PatchObjectRequest":{
+ "type":"structure",
+ "required":[
+@@ -9166,16 +9172,6 @@
+ "location":"header",
+ "locationName":"If-Match"
+ },
+- "IfModifiedSince":{
+- "shape":"IfModifiedSince",
+- "location":"header",
+- "locationName":"If-Modified-Since"
+- },
+- "IfNoneMatch":{
+- "shape":"IfNoneMatch",
+- "location":"header",
+- "locationName":"If-None-Match"
+- },
+ "IfUnmodifiedSince":{
+ "shape":"IfUnmodifiedSince",
+ "location":"header",