okigan / awscurl

curl-like access to AWS resources with AWS Signature Version 4 request signing.
MIT License
755 stars 94 forks source link

TypeError: 'map' object is not subscriptable #23

Closed sardaukar closed 7 years ago

sardaukar commented 7 years ago

After install awscurl on macOS Sierra, I get:

Traceback (most recent call last):
  File "/usr/local/bin/awscurl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 311, in main
    args.security_token
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 140, in make_request
    canonical_querystring = normalize_query_string(query)
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 227, in normalize_query_string
    for p in sorted(kv))
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 227, in <genexpr>
    for p in sorted(kv))
TypeError: 'map' object is not subscriptable

Is there a way to fix it? Thanks.

okigan commented 7 years ago

Looks like this is python 3.6 specific,

build is tested[1] with python 2.7 and 3.5.

[1] https://travis-ci.org/okigan/awscurl

On Tue, Jul 25, 2017 at 3:37 AM, Bruno Antunes notifications@github.com wrote:

After install awscurl on macOS Sierra, I get:

Traceback (most recent call last): File "/usr/local/bin/awscurl", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 311, in main args.security_token File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 140, in make_request canonical_querystring = normalize_query_string(query) File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 227, in normalize_query_string for p in sorted(kv)) File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 227, in for p in sorted(kv)) TypeError: 'map' object is not subscriptable

Is there a way to fix it? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/okigan/awscurl/issues/23, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdMXmPN3_Hna4IsaPc-S69dF2jVyIfJks5sRcVlgaJpZM4OiX7w .

okigan commented 7 years ago

@sardaukar try latest version (just published) https://pypi.python.org/pypi/awscurl/0.9

use pip uninstall awscurl folllowed by pip install awscurl

sardaukar commented 7 years ago

Just did, still have the same issue:

Collecting awscurl
Requirement already satisfied: configargparse in /usr/local/lib/python3.6/site-packages (from awscurl)
Requirement already satisfied: urllib3[secure] in /usr/local/lib/python3.6/site-packages (from awscurl)
Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from awscurl)
Requirement already satisfied: configparser in /usr/local/lib/python3.6/site-packages (from awscurl)
Requirement already satisfied: certifi; extra == "secure" in /usr/local/lib/python3.6/site-packages (from urllib3[secure]->awscurl)
Requirement already satisfied: idna<2.6,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests->awscurl)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests->awscurl)
Installing collected packages: awscurl
Successfully installed awscurl-0.9
Traceback (most recent call last):
  File "/usr/local/bin/awscurl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 324, in main
    args.security_token or args.session_token
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 143, in make_request
    canonical_querystring = normalize_query_string(query)
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 236, in normalize_query_string
    for p in sorted(kv))
  File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 236, in <genexpr>
    for p in sorted(kv))
TypeError: 'map' object is not subscriptable
okigan commented 7 years ago

What's the command line that you use to call awscurl?

On Jul 26, 2017, at 05:11, Bruno Antunes notifications@github.com wrote:

Just did, still have the same issue:

Collecting awscurl Requirement already satisfied: configargparse in /usr/local/lib/python3.6/site-packages (from awscurl) Requirement already satisfied: urllib3[secure] in /usr/local/lib/python3.6/site-packages (from awscurl) Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from awscurl) Requirement already satisfied: configparser in /usr/local/lib/python3.6/site-packages (from awscurl) Requirement already satisfied: certifi; extra == "secure" in /usr/local/lib/python3.6/site-packages (from urllib3[secure]->awscurl) Requirement already satisfied: idna<2.6,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests->awscurl) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests->awscurl) Installing collected packages: awscurl Successfully installed awscurl-0.9 Traceback (most recent call last): File "/usr/local/bin/awscurl", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 324, in main args.security_token or args.session_token File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 143, in make_request canonical_querystring = normalize_query_string(query) File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 236, in normalize_query_string for p in sorted(kv)) File "/usr/local/lib/python3.6/site-packages/awscurl/awscurl.py", line 236, in for p in sorted(kv)) TypeError: 'map' object is not subscriptable — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

sardaukar commented 7 years ago

awscurl --region eu-west-1 --service es --profile search "https://<some_elastic_search_host>/_cat/indices?v"

okigan commented 7 years ago

@sardaukar another update -- try latest version (just published) https://pypi.python.org/pypi/awscurl/0.10

use pip uninstall awscurl folllowed by pip install awscurl

sardaukar commented 7 years ago

Yep, works now! Thanks :D