Uh oh!
There was an error while loading. Please reload this page.
bpo-43984: Update winreg.SetValueEx to make sure the value set is not -1 - #25775
Conversation
shreyanavigyan
commented
May 1, 2021
Skip news |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
shreyanavigyan
commented
May 2, 2021
Can anyone please add a skip news label to this PR? |
erlend-aasland
commented
May 2, 2021
Isn't this a change of behaviour? If so, I'd say it calls for a NEWS item. |
shreyanavigyan
commented
May 2, 2021
News entry added |
erlend-aasland
commented
May 2, 2021
Perhaps you could use the bug report to write a test case? (Lib/test/test_winreg.py) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
| def test_setvalueex_negative_one_check(self): | ||
| # Test for Issue #43984, check -1 was not set by SetValueEx. | ||
| # Py2Reg, which gets called by SetValueEx, wasn't checking return | ||
| # value by PyLong_AsUnsignedLong, thus setting -1 as value in the registry. | ||
| # The implementation now checks PyLong_AsUnsignedLong return value to assure | ||
| # the value set was not -1. | ||
| try: | ||
| with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck: | ||
| with self.assertRaises(OverflowError): | ||
| SetValueEx(ck, "test_name", None, REG_DWORD, -1) | ||
| with self.assertRaises(FileNotFoundError): | ||
| with QueryValueEx(ck, "test_name") as subkey: | ||
| pass | ||
| finally: | ||
| DeleteKey(HKEY_CURRENT_USER, test_key_name) |
There was a problem hiding this comment.
There's something wrong with this test I added. My antivirus is identifying this piece of code as virus. Any thoughts?
There was a problem hiding this comment.
If any maintainers figure out the problem please add the required commit. Who cannot add commits please suggest the patch, I'll commit it.
This PR is stale because it has been open for 30 days with no activity. |
shreyanavigyan
commented
Jun 10, 2021
A Friendly Ping. |
zooba
commented
Jul 6, 2021
Sorry for the lack of review. Unfortunately, it looks like someone added a new required check, so I'll close/reopen to re-run it, but the change looks okay to me. If someone else gets back to this before I do, they can merge. |
✅ Deploy Preview for python-cpython-preview canceled.
|
zooba
commented
Dec 9, 2022
The test failure on Azure Pipelines is patchcheck reporting extra whitespace in the new test. I can't see it in the diff, but I find it's usually trailing whitespace in a comment. We shouldn't merge with that failure, or it'll show up randomly in the future. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
miss-islington
commented
Dec 9, 2022
Thanks @shreyanavigyan for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
bedevere-bot
commented
Dec 9, 2022
GH-100134 is a backport of this pull request to the 3.11 branch. |
bedevere-bot
commented
Dec 9, 2022
GH-100135 is a backport of this pull request to the 3.10 branch. |
zooba
commented
Dec 9, 2022
Thanks! FWIW, I suspect the antimalware detection was probably because it's an unsigned binary messing with the registry. Once we do our signed release, I'm sure it'll be fine. |
…n error (pythonGH-25775) (cherry picked from commit a29a7b9) Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
…n error (pythonGH-25775) (cherry picked from commit a29a7b9) Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
bpo-43984: Update winreg.SetValueEx to make sure the value set is not -1
REG_QWORDcase inPy2RegREG_DWORDcase inPy2Reghttps://bugs.python.org/issue43984