amazon-ses-developer-guide icon indicating copy to clipboard operation
amazon-ses-developer-guide copied to clipboard

Syntax error on Python script?

Open purdy opened this issue 5 years ago • 3 comments

I'm trying to use the Python script on the guide page and running into a syntax error:

$ python3 ./smtp_creds.py wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY us-east-1
  File "./smtp_creds.py", line 39
    raise ValueError(f"The {region} Region doesn't have an SMTP endpoint.")
                                                                         ^
SyntaxError: invalid syntax

purdy avatar Jan 19 '21 16:01 purdy

Hi Purdy,

What version of python are you using? When I used python 2.7, I could replicate the error.

python ./smtp_creds.py wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY us-east-1
  File "./smtp_creds.py", line 39
    raise ValueError(f"The {region} Region doesn't have an SMTP endpoint.")
                                                                         ^
SyntaxError: invalid syntax

But when I used python 3.6 and 3.7, it was working.

python3 ./smtp_creds.py wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY us-east-1
BLBM/9hSUELfq8Gw+rU1YcBjkOxGbhT2XG763xVLGWL9

yunpengeric avatar Apr 09 '21 23:04 yunpengeric

That was it ... I was using a default python on my computer, which was v2. v3 works.

purdy avatar Apr 10 '21 00:04 purdy

Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the "awsdocs" org), see the announcement on the AWS News Blog.

joshbean avatar Jun 28 '23 22:06 joshbean