stevedore – python3 load extension error

Bug #1784823 reported by Aida Palacio Hoz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
stevedore
Invalid
Undecided
Unassigned

Bug Description

Hi,

I've changed my code to use stevedore and load the entry points configured in setup.py within my code through the stevedore extension. It works fine in python2.7 but python3.

When I load the extensions in python2, it returns a dict with my extensions correctly as below:

>>> from stevedore import extension
>>> mgr = extension.ExtensionManager(namespace='extractors',
... invoke_on_load=True)
>>> mgr.extensions
[<stevedore.extension.Extension object at 0x7ff4b8ea5d50>, <stevedore.extension.Extension object at 0x7ff4b646dd10>]

The same load in python3 returns a null dict:
>>> mgr.extensions
[]

The test used in my code when I parse tox with py34 returns the following error:
Could not load 'extractorX': 'dict' object has no attribute 'iteritems'

When I googled this error, they said that iteritems function change to items for the python3X versions and it works just for python2.

Any help to make this work for both versions of python?

Many thanks and cheers,
Aida

If you have a troubleshooting or support issue, use the following resources:

 - Ask OpenStack: http://ask.openstack.org
 - The mailing list: http://lists.openstack.org
 - IRC: 'openstack' channel on Freenode

-----------------------------------
Release: 1.29.1.dev1 on 2018-07-26 22:55
SHA: e4ef5d0df45f74eac428b243192ceb7b8f8ff271
Source: https://git.openstack.org/cgit/openstack/stevedore/tree/doc/source/index.rst
URL: https://docs.openstack.org/stevedore/latest/

Tags: stevedore
description: updated
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

It sounds like you're using the iteritems() method somewhere in the code being invoked when the plugin loads. You can pass propagate_map_exceptions=True when constructing the ExtensionManager to get the traceback.

Revision history for this message
Ben Nemec (bnemec) wrote :

Sounds like this is not a bug in stevedore.

Changed in python-stevedore:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.