python-configparser 3.5.0-1 breaks the python backports namespace

Bug #1821247 reported by Dan Kegel
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
configparser (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Installing python-configparser 3.5.0-1 breaks other python modules in the backports namespace.

https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1812589 was filed against the wrong package; see also https://github.com/PiDelport/backports.os/issues/11

The problem was fixed upstream in June 2018
https://github.com/jaraco/configparser/pull/22
and the current verison (3.7.3) is ok.

To see the bug in action:

# apt update
# apt install python-pip
# su ubuntu
$ pip install --user backports.os
$ python -c "from backports import os" && echo ok
ok
$ sudo apt install python-configparser
$ Setting up python-configparser (3.5.0-1) ...
$ python -c "from backports import os" && echo ok
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name os
$ sudo apt remove python-configparser
$ pip install configparser
https://github.com/jaraco/configparser/pull/22
$ pip list | grep configparser
configparser (3.7.3)
$ python -c "from backports import os" && echo ok
ok

Please pull a fix for this configparser problem into Ubuntu 18.04. Thanks!

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: python-configparser 3.5.0-1
ProcVersionSignature: Ubuntu 4.15.0-46.49-generic 4.15.18
Uname: Linux 4.15.0-46-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.6
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Mar 21 13:57:17 2019
PackageArchitecture: all
SourcePackage: configparser
UpgradeStatus: Upgraded to bionic on 2018-04-30 (325 days ago)

Revision history for this message
Dan Kegel (dank) wrote :
Revision history for this message
Dan Kegel (dank) wrote :

See also https://github.com/jaraco/configparser/issues/17

I also verified that rebuilding the package python-configparser with the following patch, and installing that, fixes the problem here:

--- configparser-3.5.0.orig/setup.py
+++ configparser-3.5.0/setup.py
@@ -42,7 +42,6 @@ setup(
     py_modules=modules,
     package_dir={'': 'src'},
     packages=find_packages('src'),
- namespace_packages=['backports'],
     include_package_data=True,
     zip_safe=False,
     install_requires=requirements,
--- configparser-3.5.0.orig/src/backports/__init__.py
+++ configparser-3.5.0/src/backports/__init__.py
@@ -3,9 +3,3 @@

 from pkgutil import extend_path
 __path__ = extend_path(__path__, __name__)
-
-try:
- import pkg_resources
- pkg_resources.declare_namespace(__name__)
-except ImportError:
- pass

Revision history for this message
Dan Kegel (dank) wrote :

PPA https://launchpad.net/~dank/+archive/ubuntu/python-fixes/ now contains a python-configparser with that fix applied.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in configparser (Ubuntu):
status: New → Confirmed
Revision history for this message
Jesse S (jdschwa) wrote :

The upstream 3.5.x branch contains the fix too (currently 3.5.3).

The homepage is out-of-date on the configparser source package. It was moved to Github by the current maintainer.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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