def get_int_safe(cp_section, key, default_value):
    """take a ConfigParser section, get key that might be string encoded int and return int"""
    try:
        value = cp_section.getint(key, default_value)
    except ValueError:
        _value = cp_section.get(key)
        value = int(_value.strip("'").strip('"'))
    return value
