Py3.7 import failure running unit tests

Bug #1785641 reported by Corey Bryant on 2018-08-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Status tracked in Stein
Cyril Roelandt

Bug Description

Unit tested execution with py3.7 fails with import error:

Cyril Roelandt (cyril-roelandt) wrote :

So, looking at the Changelog for Python3.7:

"The configparser.ConfigParser constructor now uses read_dict() to process the default values, making its behavior consistent with the rest of the parser. Non-string keys and values in the defaults dictionary are now being implicitly converted to strings. (Contributed by James Tocknell in bpo-23835.)"

So, this *should* work.

Now, looking at msg320899 of :

$ python3.6 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})'
$ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})'
TypeError: option values must be strings

This seems to be a regression in Python, reported a few days ago.

Cyril Roelandt (cyril-roelandt) wrote :

And apparently it's fixed (thanks to Thomas Hervé for pointing this out):

Cyril Roelandt (cyril-roelandt) wrote :

Well, I spoke too fast, there are still issues with "None". See the last comment on .

Cyril Roelandt (cyril-roelandt) wrote :

I proposed to fix this bug.

Changed in glance-store:
assignee: nobody → Cyril Roelandt (cyril-roelandt)
Changed in glance-store:
status: New → Triaged
importance: Undecided → Medium

Submitter: Zuul
Branch: master

commit 6ce857397d74f792eaa25eed5326c00565aec850
Author: Cyril Roelandt <email address hidden>
Date: Tue Sep 4 18:47:31 2018 +0200

    Fix defaults for ConfigParser

    As of 3.7, the configparser module will not allow defaults values to be None.
    This patch replaces such values with "default".

    Change-Id: Id5a414412cd66d479fb8f8784cba5deddc628dfd
    Closes-Bug: #1785641

Changed in glance-store:
status: Triaged → Fix Released

This issue was fixed in the openstack/glance_store 0.28.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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