[issue32587] Make REG_MULTI_SZ support zero-length strings

Eryk Sun report at bugs.python.org
Mon May 13 17:15:18 EDT 2019


Eryk Sun <eryksun at gmail.com> added the comment:

> For tests, you should be able to create your own REG_MULTI_SZ key with 
> zero-length strings and read it back. If the winreg module won't let 
> you do it, you may need ctypes (but that's okay in Windows-only 
> tests).

winreg.SetValueEx can create the value. We just need to add a case to test_case in Lib/test/test_winreg.py, such as the following:

    ("Multi-nul", ["", "", "", ""], REG_MULTI_SZ)

> I just spent way too long looking for a MoveFileEx call that doesn't 
> exist, because this isn't actually about doing things on reboot :)

Do you mean a variation of MOVEFILE_DELAY_UNTIL_REBOOT that doesn't require administrator access? That would be useful if it existed. I suppose a MOVEFILE_DELAY_UNTIL_LOGOFF flag could be added to have the logon process (winlogon.exe, instead of smss.exe) perform the delete/rename operation under impersonation at the end of the session, or (given a system crash or power failure) the next time the user logs on.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32587>
_______________________________________


More information about the Python-bugs-list mailing list