Skip to content

winreg SetValue(Ex) should mention integer as an acceptable value #86184

Open

Description

@kainjow
mannequin
BPO 42018
Nosy @pfmoore, @tjguk, @zware, @serhiy-storchaka, @zooba, @kainjow
PRs
  • bpo-42018: winreg SetValue(Ex) should mention integer as an acceptable value #22671
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-10-12.16:21:08.662>
    labels = ['3.8', '3.9', '3.10', 'type-feature', 'OS-windows', 'docs']
    title = 'winreg SetValue(Ex) should mention integer as an acceptable value'
    updated_at = <Date 2020-10-12.18:08:05.560>
    user = 'https://github.com/kainjow'

    bugs.python.org fields:

    activity = <Date 2020-10-12.18:08:05.560>
    actor = 'serhiy.storchaka'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation', 'Windows']
    creation = <Date 2020-10-12.16:21:08.662>
    creator = 'kwojniak_box'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42018
    keywords = ['patch']
    message_count = 1.0
    messages = ['378508']
    nosy_count = 8.0
    nosy_names = ['paul.moore', 'tim.golden', 'docs@python', 'python-dev', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'kwojniak_box']
    pr_nums = ['22671']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42018'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Linked PRs

    Activity

    1. kainjow commented on Oct 12, 2020

      kainjowmannequin
      MannequinAuthor

      On https://docs.python.org/3/library/winreg.html

      For SetValue and SetValueEx is says:

      value is a string that specifies the new value.

      but value can also be an integer if the type is DWORD. Here's a test that shows that: https://github.com/python/cpython/blob/3.9/Lib/test/test_winreg.py#L339

      Suggested update:

      value is a string or integer that specifies the new value.

    2. transferred this issue fromon Apr 10, 2022
    3. aisk commented on Nov 13, 2025

      @aisk
      Member

      SetValueEx support using other types as the value, but SetValue does not according to it's defination:

      cpython/PC/winreg.c

      Lines 1719 to 1723 in d7862e9

      type: DWORD
      An integer that specifies the type of the data. Currently this must
      be REG_SZ, meaning only strings are supported.
      value as value_obj: unicode
      A string that specifies the new value.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions