alhazmy13 / serverless-offline-python

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
35 stars 18 forks source link

python3 dict to response regex fix #3

Closed euler2718 closed 5 years ago

euler2718 commented 6 years ago

match wasn't occurring in python3 (windows 10) because the \n was replaced with \r. I added the optional switch. My colleague did not have trouble with python2.7, and the change was seemingly unnecessary

euler2718 commented 6 years ago

for clarification, I'm attaching the MATCH being printed to console. This is a basic serverless app created with sls create ... -t aws-python3

seems like the conversion from python3 dict to json could be causing this difference?

slscreate

philippdonabauer commented 5 years ago

Your Regular Expression is not correct. Tested on Linux and Windows.

euler2718 commented 5 years ago

Your Regular Expression is not correct. Tested on Linux and Windows.

It's a pretty basic regex that just adds the \r switch - can you be more specific?

euler2718 commented 5 years ago

I see that you have altered this for the \r? Fine. Doesn't it match either way?

python

euler2718 commented 5 years ago

If you really want to be a stickler on how if matches, I guess this might be the way to go...

--SO (\r?\n) will cover Unix and Windows. You'll need something more complex, like (\r\n|\r|\n), if you want to match old Mac too.

philippdonabauer commented 5 years ago

Nice one ;)