From dc0de08b3fcd68e98376de664965fa330afcd5fb Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 25 Mar 2024 13:31:01 -0400 Subject: [PATCH 1/3] Fix `py.exe -m win32verstamp` command and other ISC typos --- setup.py | 2 +- win32/Demos/NetValidatePasswordPolicy.py | 2 +- win32/Demos/security/setkernelobjectsecurity.py | 4 ++-- win32/Demos/security/setnamedsecurityinfo.py | 4 ++-- win32/Demos/security/setsecurityinfo.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 4181b0f4d0..54fcc555e4 100644 --- a/setup.py +++ b/setup.py @@ -1025,7 +1025,7 @@ def link( # allow --skip-verstamp on the cmdline - but if it's not there, the # verstamp must work.) if not skip_verstamp: - args = ["py.exe", "-m" "win32verstamp"] + args = ["py.exe", "-m", "win32verstamp"] args.append(f"--version={pywin32_version}") args.append("--comments=https://github.com/mhammond/pywin32") args.append(f"--original-filename={os.path.basename(output_filename)}") diff --git a/win32/Demos/NetValidatePasswordPolicy.py b/win32/Demos/NetValidatePasswordPolicy.py index 86c3bc40bd..be9f3aa345 100644 --- a/win32/Demos/NetValidatePasswordPolicy.py +++ b/win32/Demos/NetValidatePasswordPolicy.py @@ -43,7 +43,7 @@ def main(): "-u", "--username", action="store", - help="The username to pass to the function (only for the " "change command", + help="The username to pass to the function (only for the 'change' command)", ) parser.add_option( diff --git a/win32/Demos/security/setkernelobjectsecurity.py b/win32/Demos/security/setkernelobjectsecurity.py index 34c8f44692..f82a7de516 100644 --- a/win32/Demos/security/setkernelobjectsecurity.py +++ b/win32/Demos/security/setkernelobjectsecurity.py @@ -112,9 +112,9 @@ new_sd = win32security.GetKernelObjectSecurity(ph, all_info) if new_sd.GetSecurityDescriptorDacl().GetAceCount() != dacl_ace_cnt + 1: - print("New dacl doesn" "t contain extra ace ????") + print("New dacl doesn't contain extra ace ????") if new_sd.GetSecurityDescriptorSacl().GetAceCount() != sacl_ace_cnt + 1: - print("New Sacl doesn" "t contain extra ace ????") + print("New Sacl doesn't contain extra ace ????") if ( win32security.LookupAccountSid("", new_sd.GetSecurityDescriptorOwner())[0] != "Power Users" diff --git a/win32/Demos/security/setnamedsecurityinfo.py b/win32/Demos/security/setnamedsecurityinfo.py index 8915a0df1a..6b5c342d2e 100644 --- a/win32/Demos/security/setnamedsecurityinfo.py +++ b/win32/Demos/security/setnamedsecurityinfo.py @@ -101,9 +101,9 @@ ## could do additional checking to make sure added ACE contains expected info if new_sd.GetSecurityDescriptorDacl().GetAceCount() != dacl_ace_cnt + 1: - print("New dacl doesn" "t contain extra ace ????") + print("New dacl doesn't contain extra ace ????") if new_sd.GetSecurityDescriptorSacl().GetAceCount() != sacl_ace_cnt + 1: - print("New Sacl doesn" "t contain extra ace ????") + print("New Sacl doesn't contain extra ace ????") if ( win32security.LookupAccountSid("", new_sd.GetSecurityDescriptorOwner())[0] != "Power Users" diff --git a/win32/Demos/security/setsecurityinfo.py b/win32/Demos/security/setsecurityinfo.py index d784d95099..a06a543905 100644 --- a/win32/Demos/security/setsecurityinfo.py +++ b/win32/Demos/security/setsecurityinfo.py @@ -102,9 +102,9 @@ new_sd = win32security.GetSecurityInfo(ph, win32security.SE_KERNEL_OBJECT, all_info) if new_sd.GetSecurityDescriptorDacl().GetAceCount() != dacl_ace_cnt + 1: - print("New dacl doesn" "t contain extra ace ????") + print("New dacl doesn't contain extra ace ????") if new_sd.GetSecurityDescriptorSacl().GetAceCount() != sacl_ace_cnt + 1: - print("New Sacl doesn" "t contain extra ace ????") + print("New Sacl doesn't contain extra ace ????") if ( win32security.LookupAccountSid("", new_sd.GetSecurityDescriptorOwner())[0] != "Power Users" From e00bf135d3c7653069b546c6f3c0a9c9cb76320f Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 9 May 2024 21:57:29 -0400 Subject: [PATCH 2/3] Add CHANGES --- CHANGES.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index dda19c322f..fffb8d269e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,7 +13,9 @@ https://mhammond.github.io/pywin32_installers.html. Coming in build 307, as yet unreleased -------------------------------------- + ### pywin32 +* Fixed `py.exe -m win32verstamp` command and other quote typos caused by Implied String Concatenation (#2225, @Avasam) * Release GIL when calling CreateService or StartService * Drop support for Internet Explorer 10 (#2229, @Avasam) * Removed considerations for never-built Windows CE (#2218, @Avasam) From 07eafa4f77d25b13b4bec6057ba8d3f29e5993f8 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 9 May 2024 22:02:27 -0400 Subject: [PATCH 3/3] More implicit string concatenation --- Pythonwin/pywin/test/test_pywin.py | 2 +- adodbapi/test/dbapi20.py | 6 +++--- pywin32_postinstall.py | 2 +- win32/Demos/security/sspi/socket_server.py | 2 +- win32/test/test_odbc.py | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Pythonwin/pywin/test/test_pywin.py b/Pythonwin/pywin/test/test_pywin.py index 14b4430e24..6389de930e 100644 --- a/Pythonwin/pywin/test/test_pywin.py +++ b/Pythonwin/pywin/test/test_pywin.py @@ -377,7 +377,7 @@ def t_print(*args): pywin.scintilla.IDLEenvironment.test() ed = scriptutils.GetActiveEditControl() doc = ed.GetDocument() - assert "hi " "there" in ed.GetTextRange() + assert "hi there" in ed.GetTextRange() assert doc.IsModified() # edit w auto-indent diff --git a/adodbapi/test/dbapi20.py b/adodbapi/test/dbapi20.py index a9da81b7b2..3c5fc268ff 100644 --- a/adodbapi/test/dbapi20.py +++ b/adodbapi/test/dbapi20.py @@ -453,12 +453,12 @@ def _paraminsert(self, cur): self.assertEqual( beers[0], "Cooper's", - "cursor.fetchall retrieved incorrect data, or data inserted " "incorrectly", + "cursor.fetchall retrieved incorrect data, or data inserted incorrectly", ) self.assertEqual( beers[1], "Victoria Bitter", - "cursor.fetchall retrieved incorrect data, or data inserted " "incorrectly", + "cursor.fetchall retrieved incorrect data, or data inserted incorrectly", ) trouble = "thi%s :may ca%(u)se? troub:1e" self.assertEqual( @@ -541,7 +541,7 @@ def test_fetchone(self): self.assertEqual( cur.fetchone(), None, - "cursor.fetchone should return None if a query retrieves " "no rows", + "cursor.fetchone should return None if a query retrieves no rows", ) self.assertTrue(cur.rowcount in (-1, 0)) diff --git a/pywin32_postinstall.py b/pywin32_postinstall.py index b1b9cdd214..bddb8ccd33 100644 --- a/pywin32_postinstall.py +++ b/pywin32_postinstall.py @@ -260,7 +260,7 @@ def RegisterHelpFile(register=True, lib_dir=None): SetPyKeyVal("Help\\Pythonwin Reference", None, chm_file) return chm_file else: - print("NOTE: PyWin32.chm can not be located, so has not " "been registered") + print("NOTE: PyWin32.chm can not be located, so has not been registered") else: UnsetPyKeyVal("Help\\Pythonwin Reference", None, delete_key=True) return None diff --git a/win32/Demos/security/sspi/socket_server.py b/win32/Demos/security/sspi/socket_server.py index 6bf3806bb4..09f005b46f 100644 --- a/win32/Demos/security/sspi/socket_server.py +++ b/win32/Demos/security/sspi/socket_server.py @@ -187,7 +187,7 @@ def sspi_client(): serve() else: parser.error( - "You must supply 'client' or 'server' - " "use --help for details" + "You must supply 'client' or 'server' - use --help for details" ) except KeyboardInterrupt: pass diff --git a/win32/test/test_odbc.py b/win32/test/test_odbc.py index 85b577357a..7b61cb354d 100644 --- a/win32/test/test_odbc.py +++ b/win32/test/test_odbc.py @@ -225,7 +225,7 @@ def testDates(self): def test_set_nonzero_length(self): self.assertEqual( self.cur.execute( - "insert into %s (userid,username) " "values (?,?)" % self.tablename, + "insert into %s (userid,username) values (?,?)" % self.tablename, ["Frank", "Frank Millman"], ), 1, @@ -240,7 +240,7 @@ def test_set_nonzero_length(self): def test_set_zero_length(self): self.assertEqual( self.cur.execute( - "insert into %s (userid,username) " "values (?,?)" % self.tablename, + "insert into %s (userid,username) values (?,?)" % self.tablename, [b"Frank", ""], ), 1, @@ -251,7 +251,7 @@ def test_set_zero_length(self): def test_set_zero_length_unicode(self): self.assertEqual( self.cur.execute( - "insert into %s (userid,username) " "values (?,?)" % self.tablename, + "insert into %s (userid,username) values (?,?)" % self.tablename, ["Frank", ""], ), 1,