boto / botocore

The low-level, core functionality of boto3 and the AWS CLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

botocore/awscli fails to run on python 3.2

sgnn7 opened this issue · comments

Python 3.2
Debian 7
boto 1.1.7 (python3 - easy_install3)
awscli 1.7.44 (python3 - easy_install3)

user@system:~$ aws s3 ls
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 5, in <module>
    pkg_resources.run_script('awscli==1.7.44', 'aws')
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1236, in run_script
    exec(compile(open(script_filename).read(), script_filename, 'exec'), namespace, namespace)
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/EGG-INFO/scripts/aws", line 19, in <module>
    import awscli.clidriver
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/clidriver.py", line 25, in <module>
    from awscli.formatter import get_formatter
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/formatter.py", line 20, in <module>
    from awscli.table import MultiTable, Styler, ColorizedStyler
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/table.py", line 18, in <module>
    from awscli.compat import six
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/compat.py", line 25, in <module>
    shlex_quote = six.moves.shlex_quote
  File "/usr/local/lib/python3.2/dist-packages/botocore-1.1.7-py3.2.egg/botocore/vendored/six.py", line 89, in __get__
    result = self._resolve()
  File "/usr/local/lib/python3.2/dist-packages/botocore-1.1.7-py3.2.egg/botocore/vendored/six.py", line 154, in _resolve
    return getattr(module, self.attr)
AttributeError: 'module' object has no attribute 'quote'

Looked to be an issue in function mappings at botocore/vendored/six.py (https://github.com/boto/botocore/blob/develop/botocore/vendored/six.py#L235) with 3.2->3,3 changeover but I had more errors when I manually edited that line with other modules. Moving the awscli launcher (/usr/local/bin/aws) to use python2 fixed the use for me but this seems to be a botocore bug.

Changing that one method mapping line to be pipes instead of shlex throws this aws error:

Traceback (most recent call last):
  File "/usr/local/bin/aws", line 5, in <module>
    pkg_resources.run_script('awscli==1.7.44', 'aws')
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1236, in run_script
    exec(compile(open(script_filename).read(), script_filename, 'exec'), namespace, namespace)
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/EGG-INFO/scripts/aws", line 27, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/EGG-INFO/scripts/aws", line 23, in main
    return awscli.clidriver.main()
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/clidriver.py", line 47, in main
    driver = create_clidriver()
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/clidriver.py", line 56, in create_clidriver
    event_hooks=emitter)
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/plugin.py", line 44, in load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/plugin.py", line 61, in _import_plugins
    module = __import__(path, fromlist=[module])
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/handlers.py", line 54, in <module>
    from awscli.customizations.waiters import register_add_waiters
  File "/usr/local/lib/python3.2/dist-packages/awscli-1.7.44-py3.2.egg/awscli/customizations/waiters.py", line 135
    'error': u'%s is thrown ',
                            ^
SyntaxError: invalid syntax

Botocore doesn't support python3.2, it only support 2.6,2.7,3.3+ (https://github.com/boto/botocore/blob/develop/setup.py#L52-L57).

This is primarily because many of our dependencies (e.g requests) don't support python3.2