Bug: boto3 causes SyntaxError when building/invoking with python3.11 #7526
Labels
area/build
sam build command
blocked/more-info-needed
More info is needed from the requester. If no response in 14 days, it will become stale.
stage/bug-repro
The issue/bug needs to be reproduced
Description:
Demonstrated with Hello World python3.11 template.
If you use
sam init
and choose the python 3.11 'Hello, World' templatesam build --use container
fails with asource code string cannot contain null bytes
error. This happens with no changes to Hello World.sam build
andlocal invoke -e events/event.json
succeeds.import boto3
andsam build
andlocal invoke
will now fail with the same syntax error.python3.12 or python3.10 builds succeed in all three scenarios.
Steps to reproduce:
sam build --use-container
(fails on build step)OR
hello_world/app.py
file.sam build
sam local invoke -e events/event.json
(fails on invoke step).Observed result:
For
sam build --use-container --debug
output
For
sam local invoke -e events/event.json --debug
output
Expected result:
Expected it to build and return what Hello World is supposed to return, what it returns for python3.10 and python3.12.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:{
"version": "1.123.0",
"system": {
"python": "3.8.13",
"os": "macOS-14.6.1-x86_64-i386-64bit"
},
"additional_dependencies": {
"docker_engine": "20.10.8",
"aws_cdk": "Not available",
"terraform": "1.5.7"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
12. AWS region: us-east-1
The text was updated successfully, but these errors were encountered: