Skip to content

Commit c0435d9

Browse files
Merge branch 'release-1.44.83'
* release-1.44.83: Bumping version to 1.44.83 Update changelog based on model updates fix(emr): Correct --rep-upgrade-on-boot typo in help text (#10232) Double-quote Windows alias command args if metacharacters present (#10230) Auto-detect account regional namespace buckets in s3 mb (#10213)
2 parents 6b2ccd7 + 2831a07 commit c0435d9

15 files changed

Lines changed: 274 additions & 23 deletions

File tree

.changes/1.44.83.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"category": "``cognito-idp``",
4+
"description": "Adding dutch language support for Cognito Managed Login and Terms on Console",
5+
"type": "api-change"
6+
},
7+
{
8+
"category": "``comprehendmedical``",
9+
"description": "This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.",
10+
"type": "api-change"
11+
},
12+
{
13+
"category": "``compute-optimizer``",
14+
"description": "This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.0. The SDK will prioritize its most performant protocol.",
15+
"type": "api-change"
16+
},
17+
{
18+
"category": "``compute-optimizer-automation``",
19+
"description": "This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.0. The SDK will prioritize its most performant protocol.",
20+
"type": "api-change"
21+
},
22+
{
23+
"category": "``gamelift``",
24+
"description": "This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.",
25+
"type": "api-change"
26+
},
27+
{
28+
"category": "``marketplace-entitlement``",
29+
"description": "This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.",
30+
"type": "api-change"
31+
},
32+
{
33+
"category": "``network-firewall``",
34+
"description": "Support for new types of partner managed rulegroups for Network Firewall Service",
35+
"type": "api-change"
36+
},
37+
{
38+
"category": "``sagemaker``",
39+
"description": "SageMaker AI now supports generative AI inference recommendations. Provide your model and workload, and SageMaker AI optimizes configurations, benchmarks them on real GPUs, and returns deployment-ready recommendations with validated metrics, accelerating the path to production from weeks to hours.",
40+
"type": "api-change"
41+
},
42+
{
43+
"category": "``snowball``",
44+
"description": "This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.",
45+
"type": "api-change"
46+
},
47+
{
48+
"category": "``S3``",
49+
"description": "Add support for creating S3 account regional namespace buckets with ``aws s3 mb``. The command now automatically detects bucket names matching the account-regional naming pattern and sets the required ``x-amz-bucket-namespace`` header.",
50+
"type": "enhancement"
51+
}
52+
]

CHANGELOG.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
CHANGELOG
33
=========
44

5+
1.44.83
6+
=======
7+
8+
* api-change:``cognito-idp``: Adding dutch language support for Cognito Managed Login and Terms on Console
9+
* api-change:``comprehendmedical``: This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.
10+
* api-change:``compute-optimizer``: This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.0. The SDK will prioritize its most performant protocol.
11+
* api-change:``compute-optimizer-automation``: This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.0. The SDK will prioritize its most performant protocol.
12+
* api-change:``gamelift``: This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.
13+
* api-change:``marketplace-entitlement``: This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.
14+
* api-change:``network-firewall``: Support for new types of partner managed rulegroups for Network Firewall Service
15+
* api-change:``sagemaker``: SageMaker AI now supports generative AI inference recommendations. Provide your model and workload, and SageMaker AI optimizes configurations, benchmarks them on real GPUs, and returns deployment-ready recommendations with validated metrics, accelerating the path to production from weeks to hours.
16+
* api-change:``snowball``: This release adds Smithy RPC v2 CBOR as an additional protocol alongside the existing AWS JSON 1.1. The SDK will prioritize its most performant protocol.
17+
* enhancement:``S3``: Add support for creating S3 account regional namespace buckets with ``aws s3 mb``. The command now automatically detects bucket names matching the account-regional naming pattern and sets the required ``x-amz-bucket-namespace`` header.
18+
19+
520
1.44.82
621
=======
722

awscli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import os
2020

21-
__version__ = '1.44.82'
21+
__version__ = '1.44.83'
2222

2323
#
2424
# Get our data path to be added to botocore's search path

awscli/alias.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ def __init__(self, alias_name, alias_value, invoker=subprocess.call):
289289

290290
def __call__(self, args, parsed_globals):
291291
command_components = [self._alias_value[1:]]
292-
command_components.extend(compat_shell_quote(a) for a in args)
292+
command_components.extend(
293+
compat_shell_quote(a, shell=True) for a in args
294+
)
293295
command = ' '.join(command_components)
294296
LOG.debug(
295297
'Using external alias %r with value: %r to run: %r',

awscli/compat.py

Lines changed: 76 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
default_pager = 'less -R'
7272

7373

74+
# cmd.exe characters that require double-quoting to be treated as literals.
75+
# https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd
76+
_WIN_CMD_UNSAFE_CHARS = set('&<>[]|{}^=;!\'()+,`~ \t')
77+
78+
7479
class StdinMissingError(Exception):
7580
def __init__(self):
7681
message = 'stdin is required for this operation, but is not available.'
@@ -189,7 +194,7 @@ def compat_input(prompt):
189194
return raw_input()
190195

191196

192-
def compat_shell_quote(s, platform=None):
197+
def compat_shell_quote(s, platform=None, shell=False):
193198
"""Return a shell-escaped version of the string *s*
194199
195200
Unfortunately `shlex.quote` doesn't support Windows, so this method
@@ -199,13 +204,15 @@ def compat_shell_quote(s, platform=None):
199204
platform = sys.platform
200205

201206
if platform == "win32":
202-
return _windows_shell_quote(s)
207+
if shell:
208+
return _windows_cmd_shell_quote(s)
209+
return _windows_argv_quote(s)
203210
else:
204211
return shlex.quote(s)
205212

206213

207-
def _windows_shell_quote(s):
208-
"""Return a Windows shell-escaped version of the string *s*
214+
def _windows_argv_quote(s):
215+
"""Return a Windows argv-escaped version of the string *s*
209216
210217
Windows has potentially bizarre rules depending on where you look. When
211218
spawning a process via the Windows C runtime the rules are as follows:
@@ -227,37 +234,37 @@ def _windows_shell_quote(s):
227234
return '""'
228235

229236
buff = []
230-
num_backspaces = 0
237+
num_backslashes = 0
231238
for character in s:
232239
if character == '\\':
233240
# We can't simply append backslashes because we don't know if
234241
# they will need to be escaped. Instead we separately keep track
235242
# of how many we've seen.
236-
num_backspaces += 1
243+
num_backslashes += 1
237244
elif character == '"':
238-
if num_backspaces > 0:
245+
if num_backslashes > 0:
239246
# The backslashes are part of a chain that lead up to a
240247
# double quote, so they need to be escaped.
241-
buff.append('\\' * (num_backspaces * 2))
242-
num_backspaces = 0
248+
buff.append('\\' * (num_backslashes * 2))
249+
num_backslashes = 0
243250

244251
# The double quote also needs to be escaped. The fact that we're
245252
# seeing it at all means that it must have been escaped in the
246253
# original source.
247254
buff.append('\\"')
248255
else:
249-
if num_backspaces > 0:
256+
if num_backslashes > 0:
250257
# The backslashes aren't part of a chain leading up to a
251258
# double quote, so they can be inserted directly without
252259
# being escaped.
253-
buff.append('\\' * num_backspaces)
254-
num_backspaces = 0
260+
buff.append('\\' * num_backslashes)
261+
num_backslashes = 0
255262
buff.append(character)
256263

257-
# There may be some leftover backspaces if they were on the trailing
264+
# There may be some leftover backslashes if they were on the trailing
258265
# end, so they're added back in here.
259-
if num_backspaces > 0:
260-
buff.append('\\' * num_backspaces)
266+
if num_backslashes > 0:
267+
buff.append('\\' * num_backslashes)
261268

262269
new_s = ''.join(buff)
263270
if ' ' in new_s or '\t' in new_s:
@@ -267,6 +274,60 @@ def _windows_shell_quote(s):
267274
return new_s
268275

269276

277+
def _windows_cmd_shell_quote(s):
278+
"""Return a Windows shell-escaped version of the string *s* that is
279+
safe to pass through cmd.exe
280+
281+
Handles two interpretation layers:
282+
1. cmd.exe metacharacters - neutralized by double-quoting when
283+
the string contains any cmd.exe special characters.
284+
2. MSVC C runtime argv parsing - backslash/double-quote escaping
285+
so the target process receives the correct argument.
286+
287+
Note: cmd.exe %VAR% expansion and !VAR! delayed expansion
288+
cannot be reliably escaped inside double quotes on the
289+
command line and are not handled here.
290+
291+
:param s: A string to escape
292+
:return: An escaped string
293+
"""
294+
if not s:
295+
return '""'
296+
297+
buff = []
298+
num_backslashes = 0
299+
needs_quoting = False
300+
for character in s:
301+
if character == '\\':
302+
num_backslashes += 1
303+
elif character == '"':
304+
if num_backslashes > 0:
305+
buff.append('\\' * (num_backslashes * 2))
306+
num_backslashes = 0
307+
buff.append('\\"')
308+
needs_quoting = True
309+
else:
310+
if num_backslashes > 0:
311+
buff.append('\\' * num_backslashes)
312+
num_backslashes = 0
313+
if character in _WIN_CMD_UNSAFE_CHARS:
314+
needs_quoting = True
315+
buff.append(character)
316+
317+
if needs_quoting:
318+
# Trailing backslashes must be doubled when we append a closing
319+
# double quote — without doubling, a trailing backslash would
320+
# escape the closing quote.
321+
if num_backslashes > 0:
322+
buff.append('\\' * (num_backslashes * 2))
323+
inner = ''.join(buff)
324+
return f'"{inner}"'
325+
326+
if num_backslashes > 0:
327+
buff.append('\\' * num_backslashes)
328+
return ''.join(buff)
329+
330+
270331
def get_popen_kwargs_for_pager_cmd(pager_cmd=None):
271332
"""Returns the default pager to use dependent on platform
272333

awscli/customizations/emr/helptext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
' specified. On first boot, by default, Amazon Linux AMIs'
438438
' connect to package repositories to install security updates'
439439
' before other services start. You can set this parameter'
440-
' using <code>--rep-upgrade-on-boot NONE</code> to'
440+
' using <code>--repo-upgrade-on-boot NONE</code> to'
441441
' disable these updates. CAUTION: This creates additional'
442442
' security risks.</p>'
443443
)

awscli/customizations/s3/subcommands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from awscli.customizations.s3.utils import find_bucket_key, AppendFilter, \
3232
find_dest_path_comp_key, human_readable_size, \
3333
RequestParamsMapper, split_s3_bucket_key, block_unsupported_resources, \
34-
S3PathResolver
34+
S3PathResolver, is_account_regional_namespace_bucket
3535
from awscli.customizations.utils import uni_print
3636
from awscli.customizations.s3.syncstrategy.base import MissingFileSync, \
3737
SizeAndLastModifiedSync, NeverSync, AlwaysSync
@@ -910,6 +910,9 @@ def _run_main(self, parsed_args, parsed_globals):
910910
bucket_config = {}
911911
bucket_tags = self._create_bucket_tags(parsed_args)
912912

913+
if is_account_regional_namespace_bucket(bucket):
914+
params['BucketNamespace'] = 'account-regional'
915+
913916
# Only set LocationConstraint when the region name is not us-east-1.
914917
# Sending LocationConstraint with value us-east-1 results in an error.
915918
if self.client.meta.region_name != 'us-east-1':

awscli/customizations/s3/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
)
6565

6666

67+
def is_account_regional_namespace_bucket(bucket):
68+
return bucket.endswith('-an')
69+
70+
6771
def human_readable_size(value):
6872
"""Convert a size in bytes into a human readable format.
6973

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# The short X.Y version.
5353
version = '1.44.'
5454
# The full version, including alpha/beta/rc tags.
55-
release = '1.44.82'
55+
release = '1.44.83'
5656

5757
# The language for content autogenerated by Sphinx. Refer to documentation
5858
# for a list of supported languages.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ universal = 0
33

44
[metadata]
55
requires_dist =
6-
botocore==1.42.92
6+
botocore==1.42.93
77
docutils>=0.18.1,<=0.19
88
s3transfer>=0.16.0,<0.17.0
99
PyYAML>=3.10,<6.1

0 commit comments

Comments
 (0)