Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:25:42+00:00 2026-06-13T11:25:42+00:00

I am using SafeConfigParser , my configuration file includes a [DEFAULT] section and I

  • 0

I am using SafeConfigParser, my configuration file includes a [DEFAULT] section and I am using the below code to extract that part.

parser = SafeConfigParser(allow_no_value=True)
parser.optionxform = str  # makes names case sensitive
defaultAttributesDic = parser.defaults()

However my DEFAULT section include interpolated values such as:

A= 10000
B= %(A)s

But the problem is that defaults() returns the actual raw values (not interpolated values).
Why is that? when can that be useful? I don’t get the reason behind this decision?

I am using parser.items(section) to read other sections and that works fine. Values are returned interpolated. Should i skip defaults and use items("DEFAULT") instead? Please explain this to me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:25:42+00:00Added an answer on June 13, 2026 at 11:25 am

    defaults() is a method inherited from RawConfigParser which doesn’t support interpolation.

    I think you should reserve the [DEFAULT] section for providing defaults for other sections instead of trying to “abuse” it as a “normal” section. The [DEFAULT] section has a special meaning and isn’t even included in methods like sections() or has_section().

    If you need a “default” section just call it a name other than DEFAULT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using EF Code First I have an model object that has multiple properties that
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using the code below, sublayer1 & sublayer2 are drawn where desired. When the animation
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using the code described bellow, i can sucessfully retrieve the properties stored into the
Using Code First Entity Framework with .NET MVC 4 I have created a new
Using the blender exporter packaged with Three.js I exported the .blend file from this
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.IO; using System.Linq;
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.