Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stringifying λ environment variables when using Python2 #579

Merged

Conversation

Cliffzz
Copy link
Contributor

@Cliffzz Cliffzz commented Jul 26, 2018

Issue #, if available:
#517

Description of changes:
Fix stringifying λ environment variables that are passed when using Python2.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Cliffzz Cliffzz force-pushed the feature/fix-stringifying-environment-variables branch 3 times, most recently from b649277 to 47fc234 Compare July 26, 2018 11:28
@Cliffzz Cliffzz force-pushed the feature/fix-stringifying-environment-variables branch from 47fc234 to 5b32d3c Compare July 26, 2018 11:59
@jfuss
Copy link
Contributor

jfuss commented Aug 6, 2018

@Cliffzz If you add the test case you have in this PR only, the tests pass already in Py2 and Py3. Unless I am missing something else, this is not the solution to that issue.

@Cliffzz
Copy link
Contributor Author

Cliffzz commented Aug 7, 2018

@jfuss Sorry my bad, forgot to actually add a unicode char to the string.
Updated the test so that it fails before the changes.

Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cliffzz I just have a small request to add a comment about why we need this here. I don't find it super clear by just reading the code.

@@ -191,7 +193,11 @@ def _stringify_value(self, value):
result = "false"

# value is a scalar type like int, str which can be stringified
else:
elif sys.version_info.major > 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment here on why this is needed. It is not super clear on the reason for this by just looking at the code.

@jfuss jfuss merged commit 546d271 into aws:develop Aug 7, 2018
@Cliffzz Cliffzz deleted the feature/fix-stringifying-environment-variables branch August 7, 2018 19:50
jfuss added a commit that referenced this pull request Aug 28, 2018
* fix: Functional tests must run on localhost to work in Windows (#552)

* fix: spacing typo in Log statement in start-lambda (#559)

* docs: Fix syntax highlighting in README.md (#561)

* docs: Change jest to mocha in Nodejs init README (#564)

* docs: Fix @mhart link in README (#562)

* docs(README): removed cloudtrail, added SNS to generate-event (#569)

* docs: Update repo name references (#577)

* feat(debugging): Fixing issues around debugging Golang functions. (#565)

* fix(init): Improve current init samples around docs and fixes (#558)

* docs(README): Update launch config to SAM CLI from SAM Local (#587)

* docs(README): Update sample code for calling Local Lambda Invoke (#584)

* refactor(init): renamed handler for camel case, moved callback call up (#586)

* chore: aws-lambda-java-core 1.1.0 -> 1.2.0 for java sam init (#578)

* feat(validate): Add profile and region options (#582)

Currently, `sam validate` requires AWS Creds (due to the SAM Translator).
This commits adds the ability to pass in the credientials through a profile
that is configured through `aws configure`.

* docs(README): Update README prerequisites to include awscli (#596)

* fix(start-lambda): Remove Content-Type Header check (#594)

* docs: Disambiguation "Amazon Kinesis" (#599)

* docs: Adding instructions for how to add pyenv to your PATH for Windows (#600)

* docs: Update README with small grammar fix (#601)

* fix: Update link in NodeJS package.json (#603)

* docs: Creating instructions for Windows users to install sam (#605)

* docs: Adding a note directing Windows users to use pipenv (#606)

* fix: Fix stringifying λ environment variables when using Python2 (#579)

* feat(generate-event): Added support for 50+ events (#612)

* feat(invoke): Add region parameter to all invoke related commands (#608)

* docs: Breaking up README into separate files to make it easier to read (#607)

* chore: Update JVM size params to match docker-lambda (#615)

* feat(invoke): Invoke Function Without Parameters through --no-event (#604)

* docs: Update advanced_usage.rst with clarification on --env-vars usage (#610)

* docs: Remove an extra word in the sam packaging command (#618)

* UX: Improves event names to reflect Lambda Event Sources (#619)

* docs: Fix git clone typo in installation docs (#630)

* docs(README): Callout go1.x runtime support (#631)

* docs(installation): Update sam --version command (#634)

* chore(0.6.0): SAM CLI Version bump (#635)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants