disco: python37 unittest/tox support

Bug #1813361 reported by Chad Smith on 2019-01-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Undecided
Chad Smith

Bug Description

cloud-init's xenial toxenv falls over on tip of master 7a4696596bbcccfedf5c6b6e25ad684ef30d9cea
in Ubuntu Disco python37 environments. Some of the tox dependencies like httpretty are exhibiting issues with python3.7

Make "all the tox things" work on Disco

type of errors seen running tox -r -e xenial on Disco

======================================================================
ERROR: tests.unittests.test_datasource.test_openstack.TestOpenStackDataSource.test_wb__crawl_metadata_does_not_persist
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/cloud-init/.tox/xenial/lib/python3.7/site-packages/httpretty/core.py", line 1055, in wrapper
    return test(*args, **kw)
  File "/home/ubuntu/cloud-init/tests/unittests/test_datasource/test_openstack.py", line 395, in test_wb__crawl_metadata_does_not_persist
    _register_uris(self.VERSION, EC2_FILES, EC2_META, OS_FILES)
  File "/home/ubuntu/cloud-init/tests/unittests/test_datasource/test_openstack.py", line 126, in _register_uris
    body=get_request_callback)
  File "/home/ubuntu/cloud-init/.tox/xenial/lib/python3.7/site-packages/httpretty/core.py", line 938, in register_uri
    match_querystring)
  File "/home/ubuntu/cloud-init/.tox/xenial/lib/python3.7/site-packages/httpretty/core.py", line 760, in __init__
    self.info = URIInfo.from_uri(uri, entries)
  File "/home/ubuntu/cloud-init/.tox/xenial/lib/python3.7/site-packages/httpretty/core.py", line 730, in from_uri
    result = urlsplit(uri)
  File "/usr/lib/python3.7/urllib/parse.py", line 400, in urlsplit
    url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "/usr/lib/python3.7/urllib/parse.py", line 123, in _coerce_args
    return _decode_args(args) + (_encode_result,)
  File "/usr/lib/python3.7/urllib/parse.py", line 107, in _decode_args
    return tuple(x.decode(encoding, errors) if x else '' for x in args)
  File "/usr/lib/python3.7/urllib/parse.py", line 107, in <genexpr>
    return tuple(x.decode(encoding, errors) if x else '' for x in args)
AttributeError: 're.Pattern' object has no attribute 'decode'

----------------------------------------------------------------------

Also of note: python27 interpreter isn't available on Disco, so we need to allow tox to skip py27 env if not present.

Related branches

Chad Smith (chad.smith) on 2019-01-25
Changed in cloud-init:
status: New → In Progress
assignee: nobody → Chad Smith (chad.smith)
Chad Smith (chad.smith) on 2019-01-25
description: updated

This bug is fixed with commit c7248059 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=c7248059

Changed in cloud-init:
status: In Progress → Fix Committed

This bug is believed to be fixed in cloud-init in version 19.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers