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

Code throws error for urllib module while executing through lambda. #38

Open
EPK1979 opened this issue Apr 23, 2020 · 0 comments
Open

Comments

@EPK1979
Copy link

EPK1979 commented Apr 23, 2020

{
"errorMessage": "Unable to import module 'lambda_function'"
}

I updated as below

#import urllib.request, urllib.error, urllib.parse
import urllib3

line 68 as
response = urllib3.request.urlopen(url)

but still error out as below.

{
"stackTrace": [
[
"/var/task/lambda_function.py",
51,
"lambda_handler",
"ip_ranges = json.loads(get_ip_groups_json(message['url'], message['md5']))"
],
[
"/var/task/lambda_function.py",
68,
"get_ip_groups_json",
"response = urllib3.request.urlopen(url)"
]
],
"errorType": "AttributeError",
"errorMessage": "'module' object has no attribute 'urlopen'"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant