Rance Hall wrote:

> On Fri, Mar 25, 2011 at 1:54 PM, Walter Prins <[email protected]> wrote:
>>
>> On 25 March 2011 18:26, Rance Hall <[email protected]> wrote:
>>> config_version =  config.get('versions','configver',0)
>>> This line fails under 3.2 Linux with the error message:
>>> TypeError:  get() takes exactly 3 positional arguments (4 given)
>>> What could the 4th argument be?  I only see three.
>>> This same code worked on python 3.1 under windows.

>>> What am I missing?

> Likely explanation.  But I don't think it holds water when compared
> against the configparser documentation.

Speaking of the documentation,  I think that 

http://docs.python.org/py3k/library/configparser.html#configparser.ConfigParser.get

"""
get(section, option, raw=False[, vars, fallback])
[...]
Changed in version 3.2: Arguments raw, vars and fallback are keyword only to 
protect users from trying to use the third argument as the fallback fallback 
(especially when using the mapping protocol).
"""

makes it clear that instead of 

config.get(section, option, rawflag)  # 3.1

you now have to write 

config.get(section, option, raw=rawflag) # 3.2

because many people erroneously assumed that the third argument was the 
fallback value.

Peter


_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to