fix(aws): silence invalid escape sequence SyntaxWarning in S3 bucket name validation (#12041)

Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
This commit is contained in:
Robert Saladra
2026-07-20 14:24:22 +02:00
committed by GitHub
parent 457297a5f6
commit dd81793480
2 changed files with 2 additions and 1 deletions
@@ -0,0 +1 @@
Fix invalid escape sequence `SyntaxWarning` raised on startup by the S3 bucket name validation regex
@@ -235,7 +235,7 @@ def validate_arguments(arguments: Namespace) -> tuple[bool, str]:
def validate_bucket(bucket_name: str) -> str:
"""validate_bucket validates that the input bucket_name is valid"""
if search(
"^(?!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$)(?!.*\.{2})(?!.*\.-)(?!.*-\.)(?!^xn--)(?!^sthree-)(?!^amzn-s3-demo-)(?!.*--table-s3$)[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$",
r"^(?!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$)(?!.*\.{2})(?!.*\.-)(?!.*-\.)(?!^xn--)(?!^sthree-)(?!^amzn-s3-demo-)(?!.*--table-s3$)[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$",
bucket_name,
):
return bucket_name