If the key already exists, this function opens the existing key.
The return value is the handle of the opened key. If the function fails, a
- :exc:`WindowsError` exception is raised.
+ :exc:`OSError` exception is raised.
+
+ .. versionchanged:: 3.3
+ This function used to raise a :exc:`WindowsError`, which is now an
+ alias of :exc:`OSError`.
- .. function:: CreateKeyEx(key, sub_key, reserved=0, access=KEY_ALL_ACCESS)
+ .. function:: CreateKeyEx(key, sub_key, reserved=0, access=KEY_WRITE)
Creates or opens the specified key, returning a
:ref:`handle object <handle-object>`.
*This method can not delete keys with subkeys.*
If the method succeeds, the entire key, including all of its values, is removed.
- If the method fails, a :exc:`WindowsError` exception is raised.
+ If the method fails, a :exc:`OSError` exception is raised.
+
+ .. versionchanged:: 3.3
+ This function used to raise a :exc:`WindowsError`, which is now an
+ alias of :exc:`OSError`.
- .. function:: DeleteKeyEx(key, sub_key, access=KEY_ALL_ACCESS, reserved=0)
+ .. function:: DeleteKeyEx(key, sub_key, access=KEY_WOW64_64KEY, reserved=0)
Deletes the specified key.
The result is a new handle to the specified key.
- If the function fails, :exc:`WindowsError` is raised.
+ If the function fails, :exc:`OSError` is raised.
+
+ .. versionchanged:: 3.2
+ Allow the use of named arguments.
- .. versionchanged:: 3.2 Allow the use of named arguments.
+ .. versionchanged:: 3.3
+ This function used to raise a :exc:`WindowsError`, which is now an
+ alias of :exc:`OSError`.
- .. function:: OpenKeyEx()
-
- The functionality of :func:`OpenKeyEx` is provided via :func:`OpenKey`,
- by the use of default arguments.
-
-
.. function:: QueryInfoKey(key)
Returns information about a key, as a tuple.
Core and Builtins
-----------------
-- Issue #16197: Update winreg docstrings and documentation to match code.
++- Issue #16197: Update winreg docstrings and documentation to match code.
+ Patch by Zachary Ware.
+
-- Issue #14700: Fix buggy overflow checks when handling large precisions and
- widths in old-style and new-style formatting.
+- Issue #16241: Document -X faulthandler command line option.
+ Patch by Marek Ć uppa.
- Issue #6074: Ensure cached bytecode files can always be updated by the
user that created them, even when the source file is read-only.