[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 55a6f73b49625ebff575521c3a0b919880f5f0ec by Miss Islington (bot) 
in branch '3.7':
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
https://github.com/python/cpython/commit/55a6f73b49625ebff575521c3a0b919880f5f0ec


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 44729c9f5198211faf533da49fa0fa26693a1993 by Miss Islington (bot) 
in branch '3.8':
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
https://github.com/python/cpython/commit/44729c9f5198211faf533da49fa0fa26693a1993


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

Fixed, assuming the backports merge okay.

--
assignee:  -> steve.dower
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15431
pull_request: https://github.com/python/cpython/pull/15778

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset ef66f31ce21cd759cc0c618c5c42ba6da0a06834 by Jason R. Coombs 
(Steve Dower) in branch 'master':
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
https://github.com/python/cpython/commit/ef66f31ce21cd759cc0c618c5c42ba6da0a06834


--
nosy: +jaraco

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15430
pull_request: https://github.com/python/cpython/pull/15777

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +15419
pull_request: https://github.com/python/cpython/pull/15766

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

This introduced a new warning:

c:\projects\cpython\pc\winreg.c(775): warning C4267: '-=': conversion from 
'size_t' to 'int', possible loss of data 
[C:\Projects\cpython\PCbuild\pythoncore.vcxproj]

I'll fix it (after I'm done with my current task) unless someone else gets 
there first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset ebca7eb093f31052ff9f245b306d38941c28a1ad by Miss Islington (bot) 
in branch '3.8':
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
https://github.com/python/cpython/commit/ebca7eb093f31052ff9f245b306d38941c28a1ad


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset bbf02da42e2368ae6b40015d6e92eaac4120f2dc by Miss Islington (bot) 
in branch '3.7':
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
https://github.com/python/cpython/commit/bbf02da42e2368ae6b40015d6e92eaac4120f2dc


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15400
pull_request: https://github.com/python/cpython/pull/15746

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15399
pull_request: https://github.com/python/cpython/pull/15745

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset e223ba13d8d871ee58570dfca4e82a591189cc2f by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (#13239)
https://github.com/python/cpython/commit/e223ba13d8d871ee58570dfca4e82a591189cc2f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-05-13 Thread Zackery Spytz


Zackery Spytz  added the comment:

Thank you for the comments. I've updated the PR.

> 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:

test_case? I think you mean test_data?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-05-13 Thread Eryk Sun


Eryk Sun  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-05-13 Thread Steve Dower


Steve Dower  added the comment:

Updating the title to actually reflect the issue - Zackery, could you update 
your PR and NEWS entry?

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 :)

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).

Alternatively, if you want to dive deeper into the C API code, you could expose 
the fixupMultiSz function as a private function (winreg._split_multi_sz) and 
test it directly. That's my preferred way of unit testing things like this, but 
it's a decent amount of boilerplate just for a test.

--
title: Make REG_MULTI_SZ support PendingFileRenameOperations -> Make 
REG_MULTI_SZ support zero-length strings

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com