[New-bugs-announce] [issue5774] _winreg.OpenKey() is documented with keyword arguments, but doesn't take them

Daniel Stutzbach report at bugs.python.org
Thu Apr 16 21:06:13 CEST 2009


New submission from Daniel Stutzbach <daniel at stutzbachenterprises.com>:

I noticed this in 2.6, but I imagine it affects 2.7, and 3.x as well.

The documentation for _winreg.OpenKey reads in part:

_winreg.OpenKey(key, sub_key[, res=0][, sam=KEY_READ])

However:

>>> import _winreg
>>> _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, 'Software',
sam=_winreg.KEY_ALL_ACCESS)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: OpenKey() takes no keyword arguments

Probably the OpenKey implementation should be updated to use
PyArg_ParseTupleAndKeywords instead of PyArg_ParseTuple?

----------
components: Library (Lib)
messages: 86038
nosy: stutzbach
severity: normal
status: open
title: _winreg.OpenKey() is documented with keyword arguments, but doesn't take them
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5774>
_______________________________________


More information about the New-bugs-announce mailing list