title: Python ConfigParser - module object is not callable in Fedora 23
body: <p>Trying to read an .ini db file from python to test a connection to a PostGres database</p>
  
  <p>Python Version 2.7.11</p>
  
  <p>In Fedora, I installed with</p>
  
  <h2>sudo dnf install python-configparser</h2>
  
  <p>Install  1 Package</p>
  
  <p>Total download size: 41 k
  Installed size: 144 k
  Is this ok [y/N]: y
  Downloading Packages:</p>
  
  <h2>python-configparser-3.5.0b2-0.2.fc23.noarch.rpm  40 kB/s |  41 kB     00:01</h2>
  
  <p>Total                                            31 kB/s |  41 kB     00:01
  Running transaction check
  Transaction check succeeded.
  Running transaction test
  Transaction test succeeded.
  Running transaction
    Installing  : python-configparser-3.5.0b2-0.2.fc23.noarch                 1/1
    Verifying   : python-configparser-3.5.0b2-0.2.fc23.noarch                 1/1</p>
  
  <p>Installed:
    python-configparser.noarch 3.5.0b2-0.2.fc23</p>
  
  <hr>
  
  <p>in my config.py I do a </p>
  
  <p>import configparser</p>
  
  <p>when I run my script I get 'module' object is not callable</p>
  
  <p><strong>db.ini</strong>  </p>
  
  <pre><code>[test1]
  host=IP address
  database=db
  port=5432
  user=username
  password=pswd
  
  [test2]
  host=localhost
  database=postgres
  port=7999
  user=abc
  password=abcd
  </code></pre>
  
  <p><strong>config.py</strong></p>
  
  <pre><code>#!/usr/bin/env python
  #from configparser import ConfigParser
  import configparser
  
  
  def config(filename='database.ini', section='gr'):
      # create a parser
      parser = configparser()
      # read config file
      parser.read(filename)
  
      # get section, default to gr
      db = {}
      if parser.has_section(section):
          params = parser.items(section)
          for param in params:
              db[param[0]] = param[1]
      else:
          raise Exception('Section {0} not found in the {1} file'.format(section, filename))
  
      return db
  </code></pre>
  
  <p><strong>testing.py</strong></p>
  
  <pre><code>#!/usr/bin/env python
  import psycopg2
  from config import config
  
  
  
  def connect():
      """ Connect to the PostgreSQL database server """
      conn = None
      try:
          # read connection parameters
          params = config()
  
          # connect to the PostgreSQL server
          print('Connecting to the PostgreSQL database...')
          conn = psycopg2.connect(**params)
  
          # create a cursor
          cur = conn.cursor()
  
   # execute a statement
          print('PostgreSQL database version:')
          cur.execute('SELECT version()')
  
          # display the PostgreSQL database server version
          db_version = cur.fetchone()
          print(db_version)
  
       # close the communication with the PostgreSQL
          cur.close()
      except (Exception, psycopg2.DatabaseError) as error:
          print(error)
      finally:
          if conn is not None:
              conn.close()
              print('Database connection closed.')
  
  
  if __name__ == '__main__':
      connect()
  </code></pre>
  
  <p>[root@svr mytest]# ./testing.py
  'module' object is not callable</p>
  
  <p>any ideas ? 
  thank you.</p>