Skip to content

Commit

Permalink
Merge branch 'release-1.31.15'
Browse files Browse the repository at this point in the history
* release-1.31.15:
  Bumping version to 1.31.15
  Update to latest partitions and endpoints
  Update to latest models
  Add change log
  Add test action for urllib3 1.x
  Move 100-continue behavior to use request API
  • Loading branch information
aws-sdk-python-automation committed Jul 28, 2023
2 parents ca555e4 + 79caccd commit 04dbad1
Show file tree
Hide file tree
Showing 20 changed files with 2,090 additions and 2,231 deletions.
37 changes: 37 additions & 0 deletions .changes/1.31.15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"category": "HTTP",
"description": "Move 100-continue behavior to use `HTTPConnections` request interface.",
"type": "enhancement"
},
{
"category": "``application-insights``",
"description": "This release enable customer to add/remove/update more than one workload for a component",
"type": "api-change"
},
{
"category": "``cloudformation``",
"description": "This SDK release is for the feature launch of AWS CloudFormation RetainExceptOnCreate. It adds a new parameter retainExceptOnCreate in the following APIs: CreateStack, UpdateStack, RollbackStack, ExecuteChangeSet.",
"type": "api-change"
},
{
"category": "``cloudfront``",
"description": "Add a new JavaScript runtime version for CloudFront Functions.",
"type": "api-change"
},
{
"category": "``connect``",
"description": "This release adds support for new number types.",
"type": "api-change"
},
{
"category": "``kafka``",
"description": "Amazon MSK has introduced new versions of ListClusterOperations and DescribeClusterOperation APIs. These v2 APIs provide information and insights into the ongoing operations of both MSK Provisioned and MSK Serverless clusters.",
"type": "api-change"
},
{
"category": "``pinpoint``",
"description": "Added support for sending push notifications using the FCM v1 API with json credentials. Amazon Pinpoint customers can now deliver messages to Android devices using both FCM v1 API and the legacy FCM/GCM API",
"type": "api-change"
}
]
21 changes: 21 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,24 @@ jobs:
uses: codecov/codecov-action@v3
with:
directory: tests


urllib3:
name: 'urllib3 1.x'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: true

steps:
- uses: actions/checkout@v3
- name: 'Set up Python 3.10'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python scripts/ci/install
python -m pip install "urllib3<2"
- name: Run tests
run: |
python scripts/ci/run-tests --with-cov --with-xdist
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
CHANGELOG
=========

1.31.15
=======

* enhancement:HTTP: Move 100-continue behavior to use `HTTPConnections` request interface.
* api-change:``application-insights``: This release enable customer to add/remove/update more than one workload for a component
* api-change:``cloudformation``: This SDK release is for the feature launch of AWS CloudFormation RetainExceptOnCreate. It adds a new parameter retainExceptOnCreate in the following APIs: CreateStack, UpdateStack, RollbackStack, ExecuteChangeSet.
* api-change:``cloudfront``: Add a new JavaScript runtime version for CloudFront Functions.
* api-change:``connect``: This release adds support for new number types.
* api-change:``kafka``: Amazon MSK has introduced new versions of ListClusterOperations and DescribeClusterOperation APIs. These v2 APIs provide information and insights into the ongoing operations of both MSK Provisioned and MSK Serverless clusters.
* api-change:``pinpoint``: Added support for sending push notifications using the FCM v1 API with json credentials. Amazon Pinpoint customers can now deliver messages to Android devices using both FCM v1 API and the legacy FCM/GCM API


1.31.14
=======

Expand Down
2 changes: 1 addition & 1 deletion botocore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
import re

__version__ = '1.31.14'
__version__ = '1.31.15'


class NullHandler(logging.Handler):
Expand Down
37 changes: 21 additions & 16 deletions botocore/awsrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,34 +66,34 @@ class AWSConnection:
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._original_response_cls = self.response_class
# We'd ideally hook into httplib's states, but they're all
# __mangled_vars so we use our own state var. This variable is set
# when we receive an early response from the server. If this value is
# set to True, any calls to send() are noops. This value is reset to
# false every time _send_request is called. This is to workaround the
# fact that py2.6 (and only py2.6) has a separate send() call for the
# body in _send_request, as opposed to endheaders(), which is where the
# body is sent in all versions > 2.6.
# This variable is set when we receive an early response from the
# server. If this value is set to True, any calls to send() are noops.
# This value is reset to false every time _send_request is called.
# This is to workaround changes in urllib3 2.0 which uses separate
# send() calls in request() instead of delegating to endheaders(),
# which is where the body is sent in CPython's HTTPConnection.
self._response_received = False
self._expect_header_set = False
self._send_called = False

def close(self):
super().close()
# Reset all of our instance state we were tracking.
self._response_received = False
self._expect_header_set = False
self._send_called = False
self.response_class = self._original_response_cls

def _send_request(self, method, url, body, headers, *args, **kwargs):
def request(self, method, url, body=None, headers=None, *args, **kwargs):
if headers is None:
headers = {}
self._response_received = False
if headers.get('Expect', b'') == b'100-continue':
self._expect_header_set = True
else:
self._expect_header_set = False
self.response_class = self._original_response_cls
rval = super()._send_request(
method, url, body, headers, *args, **kwargs
)
rval = super().request(method, url, body, headers, *args, **kwargs)
self._expect_header_set = False
return rval

Expand Down Expand Up @@ -210,10 +210,15 @@ def _send_message_body(self, message_body):

def send(self, str):
if self._response_received:
logger.debug(
"send() called, but reseponse already received. "
"Not sending data."
)
if not self._send_called:
# urllib3 2.0 chunks and calls send potentially
# thousands of times inside `request` unlike the
# standard library. Only log this once for sanity.
logger.debug(
"send() called, but response already received. "
"Not sending data."
)
self._send_called = True
return
return super().send(str)

Expand Down
Loading

0 comments on commit 04dbad1

Please sign in to comment.