Py3.7 import failure running unit tests

Bug #1785641 reported by Corey Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
Fix Released
Medium
Cyril Roelandt
Queens
New
Undecided
Unassigned
Rocky
New
Undecided
Unassigned
Stein
Fix Released
Medium
Cyril Roelandt

Bug Description

Unit tested execution with py3.7 fails with import error: https://paste.ubuntu.com/p/By2n4dRR8R/

Revision history for this message
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 https://bugs.python.org/issue23835 :

$ 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.

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

And apparently it's fixed (thanks to Thomas Hervé for pointing this out): https://bugs.python.org/issue33802

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

Well, I spoke too fast, there are still issues with "None". See the last comment on https://bugs.python.org/issue33802 .

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

I proposed https://review.openstack.org/#/c/599696/ to fix this bug.

Changed in glance-store:
assignee: nobody → Cyril Roelandt (cyril-roelandt)
Changed in glance-store:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (master)

Reviewed: https://review.openstack.org/599696
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=6ce857397d74f792eaa25eed5326c00565aec850
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 0.28.0

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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