Fred L. Drake, Jr. <fdr...@acm.org> added the comment:

I've attached a diagnostic script that I ran with Python 2.4..3.2 (current py3k 
HEAD); there are two output variants:

"old style":

    [section]
    option = None

"new style":

    [section]
    option

This is the output I get when running this script for each of those Python 
versions:

    2.4.6 RawConfigParser: old-style output
    2.4.6 SafeConfigParser: raised TypeError on set
    2.4.6 ConfigParser: old-style output

    2.5.5 RawConfigParser: old-style output
    2.5.5 SafeConfigParser: raised TypeError on set
    2.5.5 ConfigParser: old-style output

    2.6.5 RawConfigParser: old-style output
    2.6.5 SafeConfigParser: raised TypeError on set
    2.6.5 ConfigParser: old-style output

    2.7 RawConfigParser: new-style output
    2.7 SafeConfigParser: raised TypeError on set
    2.7 ConfigParser: new-style output

    3.1.1 RawConfigParser: old-style output
    3.1.1 SafeConfigParser: raised TypeError on set
    3.1.1 ConfigParser: old-style output

    3.2a1+ RawConfigParser: new-style output
    3.2a1+ SafeConfigParser: raised TypeError on set
    3.2a1+ ConfigParser: new-style output

Essentially: For the RawConfigParser and ConfigParser classes, the output 
changes in 2.7 and 3.2, and in a way that should be considered incorrect 
because it conflicts with the allow_no_values setting.

This is a bug and should be fixed in both 2.7 and 3.2.

The TypeError-on-set is consistently raised only for SafeConfigParser, and 
should remain unchanged.  (Why this was handled differently for 
SafeConfigParser I don't recall offhand.)

----------
Added file: http://bugs.python.org/file18717/cpsample.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7005>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to