Public bug reported:

Hello,

I installed python-configparser in Ubuntu 13.04 (raring) and noticed
that this module is broken. After removing the package and installing a
recent version, my code works as expected.

My test case:

File conf:
--------------------------
[test]

key = value

File test.py
--------------------------
#!/usr/bin/python
import configparser

co = configparser.RawConfigParser()
co.read('conf')
print co.get('test', 'key')

My system
--------------------------
$ lsb_release -a
LSB Version:    
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 13.04
Release:        13.04
Codename:       raring

Package info
--------------------------
$ apt-cache show python-configparser
Package: python-configparser
Priority: optional
Section: universe/python
Installed-Size: 126
Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
Original-Maintainer: Agustin Henze <t...@sluc.org.ar>
Architecture: all
Source: configparser
Version: 3.2.0r3-1
Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8)
Filename: pool/universe/c/configparser/python-configparser_3.2.0r3-1_all.deb
Size: 25764
MD5sum: c39520945ce016f3eba84d221e7d2aa4
SHA1: de8e77ed65725ddf2bed5c7caefb0d323972195c
SHA256: 9044eb841aaed929cb1f77c4c387ae7563906a6c8ca14d104c85fde8a7e8ccb9
Description-en: backport of the enhanced config parser in Python 3.2
 The ancient ConfigParser module available in the standard library 2.x has
 seen a major update in Python 3.2. This is a backport of those changes so
 that they can be used directly in Python 2.7.
Homepage: https://bitbucket.org/ambv/configparser
Description-md5: fe6da1970dfb481844f97918c3b937fe
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

My python
--------------------------
$ python --version
Python 2.7.4

Run testcase with error
--------------------------
$ python test.py 
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    print co.get('test', 'key')
  File "/usr/lib/python2.7/dist-packages/configparser.py", line 798, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python2.7/dist-packages/configparser.py", line 1154, in 
_unify_values
    raise NoSectionError(section)
configparser.NoSectionError: No section: 'test'

Remove python-configparser
--------------------------
$ sudo apt-get remove python-configparser 
[...]
The following packages will be REMOVED:
  python-configparser
0 upgraded, 0 newly installed, 1 to remove and 7 not upgraded.
After this operation, 129 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 490036 files and directories currently installed.)
Removing python-configparser ...

Using a recent version
--------------------------
$ sudo pip install configparser
Downloading/unpacking configparser
  Downloading configparser-3.3.0r2.tar.gz
  Running setup.py egg_info for package configparser
    
Installing collected packages: configparser
  Running setup.py install for configparser
    deleting configparser.egg-info/requires.txt
    
Successfully installed configparser
Cleaning up...

Retest
--------------------------
$ python test.py 
value

** Affects: configparser (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1212796

Title:
  python-configparser 3.2.0r3-1 seems to be broken

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/configparser/+bug/1212796/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to