Eryk Sun added the comment: > I don't like the idea of having a mismatch between what we set and > what we get, even if what we're setting technically shouldn't be > allowed.
Currently if you set a string with null, you won't see it using either regedit.exe or reg.exe: >>> import os, winreg >>> data = "a string\x00 with a null" >>> HKCU = winreg.HKEY_CURRENT_USER >>> winreg.SetValueEx(HKCU, "test", 0, winreg.REG_SZ, data) >>> winreg.QueryValueEx(HKCU, "test") ('a string\x00 with a null', 1) >>> os.system('reg query HKCU /v test') HKEY_CURRENT_USER test REG_SZ a string 0 The registry saves the whole buffer, agnostic to the type, but clearly Microsoft has documented and treats REG_SZ as a null-terminated string. We should follow suit. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25778> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com