From d2d12e8f2c86796d3b2841ba4da2342c9ebe1f03 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 24 Jul 2023 16:10:55 -0400 Subject: [PATCH 1/2] [Doc] Fix lowercase DLL names and standardize uppercase `X` for variable version number --- CHANGES.txt | 2 +- Pythonwin/pywin/framework/mdi_pychecker.py | 2 +- Pythonwin/pywin/idle/PyParse.py | 2 +- adodbapi/adodbapi.py | 2 +- adodbapi/apibase.py | 4 ++-- adodbapi/remote.py | 2 +- adodbapi/test/dbapi20.py | 4 ++-- com/pythoncom.py | 2 +- com/win32com/client/build.py | 2 +- com/win32com/src/PythonCOMLoader.cpp | 6 +++--- com/win32com/src/include/PythonCOM.h | 4 ++-- com/win32com/src/oleargs.cpp | 4 ++-- com/win32com/test/testGIT.py | 2 +- com/win32com/test/testPyComTest.py | 2 +- com/win32comext/axdebug/src/PyIDebugStackFrame.cpp | 2 +- com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp | 2 +- com/win32comext/propsys/src/propsys.cpp | 4 ++-- pywin32_postinstall.py | 4 ++-- setup.py | 2 +- win32/Demos/OpenEncryptedFileRaw.py | 2 +- win32/Demos/c_extension/win32_extension.cpp | 2 +- win32/Demos/win32cred_demo.py | 2 +- win32/Demos/win32gui_dialog.py | 2 +- win32/Lib/dbi.py | 2 +- win32/Lib/pywintypes.py | 4 ++-- win32/Lib/win32con.py | 2 +- win32/Lib/win32timezone.py | 2 +- win32/Lib/win32traceutil.py | 2 +- win32/help/win32net.html | 2 +- win32/scripts/regsetup.py | 2 +- win32/scripts/setup_d.py | 4 ++-- win32/src/PyTime.cpp | 2 +- win32/src/PyUnicode.cpp | 6 +++--- win32/src/PyWinTypes.h | 6 +++--- win32/src/PyWinTypesmodule.cpp | 4 ++-- win32/src/_win32sysloader.cpp | 2 +- win32/src/odbc.cpp | 2 +- win32/src/win32file.i | 2 +- win32/src/win32helpmodule.cpp | 2 +- 39 files changed, 54 insertions(+), 54 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index c31fd2dbe..7a238523f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -69,7 +69,7 @@ Build 305, released 2022-11-06 from there. (#1908) * Dropped support for allowing a bytes object to be passed where a COM BSTR - is expected - this support was accidental on the path from 2.x->3.x. + is expected - this support was accidental on the path from Python 2 -> 3. * win32crypt's PyCERTSTORE.CertCloseStore()'s `Flags` argument has been deprecated as it is likely to crash the process if diff --git a/Pythonwin/pywin/framework/mdi_pychecker.py b/Pythonwin/pywin/framework/mdi_pychecker.py index db1662b46..06fbcc82b 100644 --- a/Pythonwin/pywin/framework/mdi_pychecker.py +++ b/Pythonwin/pywin/framework/mdi_pychecker.py @@ -17,7 +17,7 @@ ## the PATH. Example pychecker.bat: ## ## REM pychecker.bat -## C:\bin\python.exe C:\PYTHON23\Lib\site-packages\pychecker\checker.py %1 %2 %3 %4 %5 %6 %7 %8 %9 +## C:\bin\python.exe C:\PythonXX\Lib\site-packages\pychecker\checker.py %1 %2 %3 %4 %5 %6 %7 %8 %9 ## ## Adding it as default module in PythonWin: ## diff --git a/Pythonwin/pywin/idle/PyParse.py b/Pythonwin/pywin/idle/PyParse.py index 173336cad..c5b371f31 100644 --- a/Pythonwin/pywin/idle/PyParse.py +++ b/Pythonwin/pywin/idle/PyParse.py @@ -154,7 +154,7 @@ def set_str(self, str): # no way to tell the differences between output, >>> etc and # user input. Indeed, IDLE's first output line makes the rest # look like it's in an unclosed paren!: - # Python 1.5.2 (#0, Apr 13 1999, ... + # Python X.X.X (#0, Apr 13 1999, ... def find_good_parse_start(self, use_ps1, is_char_in_string=None): str, pos = self.str, None diff --git a/adodbapi/adodbapi.py b/adodbapi/adodbapi.py index 36a2c8896..1dcca42c1 100644 --- a/adodbapi/adodbapi.py +++ b/adodbapi/adodbapi.py @@ -91,7 +91,7 @@ def getIndexedValue(obj, index): from collections.abc import Mapping -# --- define objects to smooth out Python3000 <-> Python 2.x differences +# --- define objects to smooth out Python3000 <-> Python 2 differences unicodeType = str longType = int StringTypes = str diff --git a/adodbapi/apibase.py b/adodbapi/apibase.py index d16265917..19ae54814 100644 --- a/adodbapi/apibase.py +++ b/adodbapi/apibase.py @@ -26,7 +26,7 @@ DateTime = type(NotImplemented) # should never be seen on win32 NullTypes = type(None) -# --- define objects to smooth out Python3 <-> Python 2.x differences +# --- define objects to smooth out Python3 <-> Python 2 differences unicodeType = str longType = int StringTypes = str @@ -55,7 +55,7 @@ def standardErrorHandler(connection, cursor, errorclass, errorvalue): raise errorclass(errorvalue) -# Note: _BaseException is defined differently between Python 2.x and 3.x +# Note: _BaseException is defined differently between Python 2 and 3 class Error(_BaseException): pass # Exception that is the base class of all other error # exceptions. You can use this to catch all errors with one diff --git a/adodbapi/remote.py b/adodbapi/remote.py index ae22b5a7e..910c6b49a 100644 --- a/adodbapi/remote.py +++ b/adodbapi/remote.py @@ -62,7 +62,7 @@ if verbose: print(version) -# --- define objects to smooth out Python3 <-> Python 2.x differences +# --- define objects to smooth out Python3 <-> Python 2 differences unicodeType = str # this line will be altered by 2to3.py to '= str' longType = int # this line will be altered by 2to3.py to '= int' StringTypes = str diff --git a/adodbapi/test/dbapi20.py b/adodbapi/test/dbapi20.py index 5f983cdc8..2cd833577 100644 --- a/adodbapi/test/dbapi20.py +++ b/adodbapi/test/dbapi20.py @@ -18,13 +18,13 @@ import time import unittest -if sys.version[0] >= "3": # python 3.x +if sys.version[0] >= "3": # Python 3 _BaseException = Exception def _failUnless(self, expr, msg=None): self.assertTrue(expr, msg) -else: # python 2.x +else: # Python 2 from exceptions import Exception as _BaseException def _failUnless(self, expr, msg=None): diff --git a/com/pythoncom.py b/com/pythoncom.py index 2180ecc32..ef68dc666 100644 --- a/com/pythoncom.py +++ b/com/pythoncom.py @@ -1,4 +1,4 @@ -# Magic utility that "redirects" to pythoncomxx.dll +# Magic utility that "redirects" to pythoncomXX.dll import pywintypes pywintypes.__import_pywin32_system_module__("pythoncom", globals()) diff --git a/com/win32com/client/build.py b/com/win32com/client/build.py index dc43aae0a..ff1865f83 100644 --- a/com/win32com/client/build.py +++ b/com/win32com/client/build.py @@ -769,7 +769,7 @@ def BuildCallList( defArgVal = defUnnamedArg argName = MakePublicAttributeName(argName) - # insanely long lines with an 'encoding' flag crashes python 2.4.0 + # insanely long lines with an 'encoding' flag crashes Python 2.4.0 # keep 5 args per line # This may still fail if the arg names are insane, but that seems # unlikely. See also _BuildArgList() diff --git a/com/win32com/src/PythonCOMLoader.cpp b/com/win32com/src/PythonCOMLoader.cpp index daca9ac3a..e9a149748 100644 --- a/com/win32com/src/PythonCOMLoader.cpp +++ b/com/win32com/src/PythonCOMLoader.cpp @@ -1,5 +1,5 @@ -// *sob* - a simple loader for pythoncomxx.dll - but this DLL has a -// manifest referencing the CRT whereas pythoncomxx.dll does not. +// *sob* - a simple loader for pythoncomXX.dll - but this DLL has a +// manifest referencing the CRT whereas pythoncomXX.dll does not. #include "windows.h" #include "tchar.h" @@ -61,7 +61,7 @@ typedef HRESULT(STDAPICALLTYPE *PFNDllGetClassObject)(REFCLSID rclsid, REFIID ri PFNDllGetClassObject pfnDllGetClassObject = NULL; ///////////////////////////////////////////////////////////////////////////// -// Loads pythoncomxx.dll after activating our context and delegates the call to it. +// Loads pythoncomXX.dll after activating our context and delegates the call to it. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { if (pfnDllGetClassObject == 0) { diff --git a/com/win32com/src/include/PythonCOM.h b/com/win32com/src/include/PythonCOM.h index e75997179..c8b7da82f 100644 --- a/com/win32com/src/include/PythonCOM.h +++ b/com/win32com/src/include/PythonCOM.h @@ -77,10 +77,10 @@ #define PYCOM_EXPORT #else #ifdef BUILD_PYTHONCOM -/* We are building pythoncomxx.dll */ +/* We are building pythoncomXX.dll */ #define PYCOM_EXPORT __declspec(dllexport) #else -/* This module uses pythoncomxx.dll */ +/* This module uses pythoncomXX.dll */ #define PYCOM_EXPORT __declspec(dllimport) #ifndef _DEBUG #pragma comment(lib, "pythoncom.lib") diff --git a/com/win32com/src/oleargs.cpp b/com/win32com/src/oleargs.cpp index a28bbc0d6..c6fad6c21 100644 --- a/com/win32com/src/oleargs.cpp +++ b/com/win32com/src/oleargs.cpp @@ -127,7 +127,7 @@ BOOL PyCom_VariantFromPyObject(PyObject *obj, VARIANT *var) } V_VT(var) = VT_BSTR; } - // For 3.x, bool checks need to be above PyLong_Check, which now succeeds for booleans. + // For Python 3, bool checks need to be above PyLong_Check, which now succeeds for booleans. else if (obj == Py_True) { V_VT(var) = VT_BOOL; V_BOOL(var) = VARIANT_TRUE; @@ -593,7 +593,7 @@ static BOOL PyCom_SAFEARRAYFromPyObjectBuildDimension(PyObject *obj, SAFEARRAY * static long PyCom_CalculatePyObjectDimension(PyObject *obItemCheck, long lDimension, PyObject *ppyobDimensionDictionary) { // Buffers are a special case - they define 1 new dimension. - // Buffers supported sequence semantics in 2.x, but for some reason memoryview objects + // Buffers supported sequence semantics in Python 2, but for some reason memoryview objects // in py3k do not, so check separately if (PYWIN_BUFFER_CHECK(obItemCheck)) return lDimension + 1; diff --git a/com/win32com/test/testGIT.py b/com/win32com/test/testGIT.py index 2ec6bc44b..3f9a5f420 100644 --- a/com/win32com/test/testGIT.py +++ b/com/win32com/test/testGIT.py @@ -134,7 +134,7 @@ def test(fn): if __name__ == "__main__": test(BeginThreadsSimpleMarshal) win32api.Sleep(500) - # Doing CoUninit here stop Pythoncom.dll hanging when DLLMain shuts-down the process + # Doing CoUninit here stop pythoncom.dll hanging when DLLMain shuts-down the process pythoncom.CoUninitialize() if pythoncom._GetInterfaceCount() != 0 or pythoncom._GetGatewayCount() != 0: print( diff --git a/com/win32com/test/testPyComTest.py b/com/win32com/test/testPyComTest.py index e7b065b23..8e4a61765 100644 --- a/com/win32com/test/testPyComTest.py +++ b/com/win32com/test/testPyComTest.py @@ -128,7 +128,7 @@ def _DumpFireds(self): # A simple handler class that derives from object (ie, a "new style class") - -# only relevant for Python 2.x (ie, the 2 classes should be identical in 3.x) +# only relevant for Python 2 (ie, the 2 classes should be identical in Python 3) class NewStyleRandomEventHandler(object): def _Init(self): self.fireds = {} diff --git a/com/win32comext/axdebug/src/PyIDebugStackFrame.cpp b/com/win32comext/axdebug/src/PyIDebugStackFrame.cpp index f715d2d05..c119e29a0 100644 --- a/com/win32comext/axdebug/src/PyIDebugStackFrame.cpp +++ b/com/win32comext/axdebug/src/PyIDebugStackFrame.cpp @@ -71,7 +71,7 @@ PyObject *PyIDebugStackFrame::GetLanguageString(PyObject *self, PyObject *args) BSTR pbstrDescription; BOOL flong; // @pyparm int|fLong||If False, just the language name should be provided, eg, "Python". If True a full product - // description may be provided (eg, "Python 1.4 ActiveX Debugging Host") + // description may be provided (eg, "Python X.X ActiveX Debugging Host") if (!PyArg_ParseTuple(args, "i:GetLanguageString", &flong)) return NULL; PY_INTERFACE_PRECALL; diff --git a/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp b/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp index 548835d33..707bd2a9d 100644 --- a/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp +++ b/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp @@ -174,7 +174,7 @@ HMODULE LoadMailClientFromMSIData(HKEY hkeyMapiClient) /* * LoadMAPIFromSystemDir - * Fall back for loading System32\Mapi32.dll if all else fails + * Fall back for loading System32\mapi32.dll if all else fails */ HMODULE LoadMAPIFromSystemDir() { diff --git a/com/win32comext/propsys/src/propsys.cpp b/com/win32comext/propsys/src/propsys.cpp index 3172692c1..613f540fb 100644 --- a/com/win32comext/propsys/src/propsys.cpp +++ b/com/win32comext/propsys/src/propsys.cpp @@ -421,7 +421,7 @@ static PyObject *PyPSGetPropertyFromPropertyStorage(PyObject *self, PyObject *ar PROPERTYKEY key; PROPVARIANT val; PyObject *obbuf; - // @pyparm buffer|ps||Bytes or buffer (or str in python 2) containing a serialized property set (see ) // @pyparm |key||Property to return if (!PyArg_ParseTuple(args, "OO&:PSGetPropertyFromPropertyStorage", &obbuf, PyWinObject_AsPROPERTYKEY, &key)) @@ -446,7 +446,7 @@ static PyObject *PyPSGetNamedPropertyFromPropertyStorage(PyObject *self, PyObjec TmpWCHAR name; PROPVARIANT val; PyObject *obname, *obbuf; - // @pyparm buffer|ps||Bytes or buffer (or str in python 2) containing a serialized property set (see ) // @pyparm str|name||Property to return if (!PyArg_ParseTuple(args, "OO:PSGetNamedPropertyFromPropertyStorage", &obbuf, &obname)) diff --git a/pywin32_postinstall.py b/pywin32_postinstall.py index 147f0cde7..50fe07efb 100644 --- a/pywin32_postinstall.py +++ b/pywin32_postinstall.py @@ -1,6 +1,6 @@ # postinstall script for pywin32 # -# copies PyWinTypesxx.dll and PythonCOMxx.dll into the system directory, +# copies pywintypesXX.dll and pythoncomXX.dll into the system directory, # and creates a pth file import glob import os @@ -69,7 +69,7 @@ def flush(self): try: # When this script is run from inside the bdist_wininst installer, # file_created() and directory_created() are additional builtin - # functions which write lines to Python23\pywin32-install.log. This is + # functions which write lines to PythonXX\pywin32-install.log. This is # a list of actions for the uninstaller, the format is inspired by what # the Wise installer also creates. file_created diff --git a/setup.py b/setup.py index 82fd384a6..a02af3224 100644 --- a/setup.py +++ b/setup.py @@ -879,7 +879,7 @@ def swig_sources(self, sources, ext=None): # A class deriving from other than the default swig_cmd.extend(["-com_interface_parent", interface_parent]) - # This 'newer' check helps python 2.2 builds, which otherwise + # This 'newer' check helps Python 2.2 builds, which otherwise # *always* regenerate the .cpp files, meaning every future # build for any platform sees these as dirty. # This could probably go once we generate .cpp into the temp dir. diff --git a/win32/Demos/OpenEncryptedFileRaw.py b/win32/Demos/OpenEncryptedFileRaw.py index aa0f2a7c1..dd03861c4 100644 --- a/win32/Demos/OpenEncryptedFileRaw.py +++ b/win32/Demos/OpenEncryptedFileRaw.py @@ -9,7 +9,7 @@ def ReadCallback(input_buffer, data, buflen): fnamein, fnameout, f = data ## print fnamein, fnameout, buflen f.write(input_buffer) - ## python 2.3 throws an error if return value is a plain int + ## Python 2.3 throws an error if return value is a plain int return winerror.ERROR_SUCCESS diff --git a/win32/Demos/c_extension/win32_extension.cpp b/win32/Demos/c_extension/win32_extension.cpp index 8768424e3..eb1c91d53 100644 --- a/win32/Demos/c_extension/win32_extension.cpp +++ b/win32/Demos/c_extension/win32_extension.cpp @@ -1,6 +1,6 @@ // Note: this sample does nothing useful other than to show you how // your own Python extension can link with and use the functions from -// pywintypesxx.dll +// pywintypesXX.dll #include "Python.h" #include "PyWinTypes.h" diff --git a/win32/Demos/win32cred_demo.py b/win32/Demos/win32cred_demo.py index 3b49ca7c8..c51cc7262 100644 --- a/win32/Demos/win32cred_demo.py +++ b/win32/Demos/win32cred_demo.py @@ -47,7 +47,7 @@ mc = win32cred.CredMarshalCredential(win32cred.UsernameTargetCredential, target) # As of pywin32 301 this no longer works for markh and unclear when it stopped, or -# even if it ever did! # Fails in Python 2.7 too, so not a 3.x regression. +# even if it ever did! # Fails in Python 2.7 too, so not a Python 3 regression. try: th = win32security.LogonUser( mc, diff --git a/win32/Demos/win32gui_dialog.py b/win32/Demos/win32gui_dialog.py index e3b89ba9d..32625fde7 100644 --- a/win32/Demos/win32gui_dialog.py +++ b/win32/Demos/win32gui_dialog.py @@ -146,7 +146,7 @@ def _RegisterWndClass(self): wc.cbWndExtra = win32con.DLGWINDOWEXTRA + struct.calcsize("Pi") icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE - ## py.ico went away in python 2.5, load from executable instead + ## py.ico went away in Python 2.5, load from executable instead this_app = win32api.GetModuleHandle(None) try: wc.hIcon = win32gui.LoadIcon(this_app, 1) ## python.exe and pythonw.exe diff --git a/win32/Lib/dbi.py b/win32/Lib/dbi.py index c33d6721e..7bdf215b0 100644 --- a/win32/Lib/dbi.py +++ b/win32/Lib/dbi.py @@ -3,7 +3,7 @@ Use of objects created by this module should be replaced with native Python objects. Dates are now returned as datetime.datetime objects, but will still accept PyTime objects also. -Raw data for binary fields should be passed as buffer objects for Python 2.x, +Raw data for binary fields should be passed as buffer objects for Python 2, and memoryview objects in Py3k. """ diff --git a/win32/Lib/pywintypes.py b/win32/Lib/pywintypes.py index 115c4f82f..1f5b57184 100644 --- a/win32/Lib/pywintypes.py +++ b/win32/Lib/pywintypes.py @@ -1,4 +1,4 @@ -# Magic utility that "redirects" to pywintypesxx.dll +# Magic utility that "redirects" to pywintypesXX.dll import importlib.machinery import importlib.util import os @@ -58,7 +58,7 @@ def __import_pywin32_system_module__(modname, globs): # first (which is how we are here) or if, eg, win32api was imported # first thereby implicitly loading the DLL. - # Sadly though, it doesn't quite work - if pywintypesxx.dll + # Sadly though, it doesn't quite work - if pywintypesXX.dll # is in system32 *and* the executable's directory, on XP SP2, an # import of win32api will cause Windows to load pywintypes # from system32, where LoadLibrary for that name will diff --git a/win32/Lib/win32con.py b/win32/Lib/win32con.py index 9916ba4ab..5e798ee29 100644 --- a/win32/Lib/win32con.py +++ b/win32/Lib/win32con.py @@ -23,7 +23,7 @@ OFN_NOLONGNAMES = 262144 OFN_EXPLORER = 524288 # new look commdlg OFN_NODEREFERENCELINKS = 1048576 -OFN_LONGNAMES = 2097152 # force long names for 3.x modules +OFN_LONGNAMES = 2097152 # force long names for Python 3 modules OFN_ENABLEINCLUDENOTIFY = 4194304 # send include message to callback OFN_ENABLESIZING = 8388608 OFN_DONTADDTORECENT = 33554432 diff --git a/win32/Lib/win32timezone.py b/win32/Lib/win32timezone.py index d0b9a08d1..564097936 100644 --- a/win32/Lib/win32timezone.py +++ b/win32/Lib/win32timezone.py @@ -923,7 +923,7 @@ class RangeMap(dict): the sorted list of keys. One may supply keyword parameters to be passed to the sort function used - to sort keys (i.e. cmp [python 2 only], keys, reverse) as sort_params. + to sort keys (i.e. cmp [Python 2 only], keys, reverse) as sort_params. Let's create a map that maps 1-3 -> 'a', 4-6 -> 'b' >>> r = RangeMap({3: 'a', 6: 'b'}) # boy, that was easy diff --git a/win32/Lib/win32traceutil.py b/win32/Lib/win32traceutil.py index 0eb38423e..87f4ee987 100644 --- a/win32/Lib/win32traceutil.py +++ b/win32/Lib/win32traceutil.py @@ -11,7 +11,7 @@ # # then, switch to a DOS prompt, and type: # C:>python.exe -# Python 1.4 etc... +# Python X.X.X (#0, Apr 13 1999, ... # >>> import win32traceutil # Redirecting output to win32trace remote collector # >>> print "Hello" diff --git a/win32/help/win32net.html b/win32/help/win32net.html index 0ec994900..6ad7ecd2f 100644 --- a/win32/help/win32net.html +++ b/win32/help/win32net.html @@ -70,7 +70,7 @@

Introduction

win32net called win32netcon that houses all of the constants needed by the win32net modules.

-Because of unicode support in python2.0, some of the string handling +Because of unicode support in Python 2.0, some of the string handling done w/the examples are no longer necessary. Before one needed to convert PyUnicode to a regular python string, before you could use string functions with it. The examples will work w/both versions of diff --git a/win32/scripts/regsetup.py b/win32/scripts/regsetup.py index f04dbda76..5acd2bdb0 100644 --- a/win32/scripts/regsetup.py +++ b/win32/scripts/regsetup.py @@ -504,7 +504,7 @@ def RegisterShellInfo(searchPaths): "regsetup c:\\wierd\\spot\\1 c:\\wierd\\spot\\2" Attempts to setup the core Python. Looks in some standard places, as well as the 2 wierd spots to locate the core Python files (eg, Python.exe, -python14.dll, the standard library and Win32 Extensions. +pythonXX.dll, the standard library and Win32 Extensions). "regsetup -a myappname . .\subdir" Registers a new Pythonpath entry named myappname, with "C:\\I\\AM\\HERE" and diff --git a/win32/scripts/setup_d.py b/win32/scripts/setup_d.py index babd83596..82205049e 100644 --- a/win32/scripts/setup_d.py +++ b/win32/scripts/setup_d.py @@ -1,4 +1,4 @@ -# Install and register pythonxx_d.dll, pywintypesxx_d.dll and pythoncomxx_d.dll +# Install and register pythonXX_d.dll, pywintypesXX_d.dll and pythoncomXX_d.dll # # Assumes the _d files can be found in the same directory as this script # or in the cwd. @@ -14,7 +14,7 @@ def usage_and_die(rc): print() print("This script is designed to copy and register the Python debug") - print("binaries. It looks for pythonxx_d.dll, pythoncomxx_d.dll etc,") + print("binaries. It looks for pythonXX_d.dll, pythoncomXX_d.dll etc,") print("and installs them to work correctly with Python debug builds.") print() print("You will generally find this script in the. zip file that") diff --git a/win32/src/PyTime.cpp b/win32/src/PyTime.cpp index 5d751d87b..de0c32cda 100644 --- a/win32/src/PyTime.cpp +++ b/win32/src/PyTime.cpp @@ -412,7 +412,7 @@ PyObject *PyWin_NewTime(PyObject *timeOb) PyObject *ret = PyDateTimeAPI->DateTime_FromTimestamp((PyObject *)(&PyWinDateTimeType), args, NULL); if (ret == NULL) { // datetime throws an OSError on failure, but for compatibility with - // Python 2.x, we turn that into a ValueError. + // Python 2, we turn that into a ValueError. PyErr_Clear(); PyErr_SetString(PyExc_ValueError, "invalid timestamp"); } diff --git a/win32/src/PyUnicode.cpp b/win32/src/PyUnicode.cpp index 34a300578..5bb7b084d 100644 --- a/win32/src/PyUnicode.cpp +++ b/win32/src/PyUnicode.cpp @@ -13,8 +13,8 @@ BOOL PyWinObject_AsPfnAllocatedWCHAR(PyObject *stringObject, void *(*pfnAllocato { BOOL rc = TRUE; if (PyBytes_Check(stringObject)) { - // XXX - this was ported from the python 2 string api - which I thought - // included the trailing \0. But the 3.x `Bytes` API does not (right?), + // XXX - this was ported from the Python 2 string api - which I thought + // included the trailing \0. But the Python 3 `Bytes` API does not (right?), // so there's some trailing \0 confusion here. Py_ssize_t cch = PyBytes_Size(stringObject); const char *buf = PyBytes_AsString(stringObject); @@ -175,7 +175,7 @@ void PyWin_AutoFreeBstr::SetBstr(BSTR bstr) BOOL PyWinObject_AsBstr(PyObject *stringObject, BSTR *pResult, BOOL bNoneOK /*= FALSE*/, DWORD *pResultLen /*= NULL*/) { BOOL rc = TRUE; - // This used to support bytes as we moved to 3.x, but a BSTR has always been + // This used to support bytes as we moved to Python 3, but a BSTR has always been // unicode (ie, you'd never *try* and use bytes to create it), so there's no // sane b/w compat reason to support that any more. if (PyUnicode_Check(stringObject)) { diff --git a/win32/src/PyWinTypes.h b/win32/src/PyWinTypes.h index edfdb0b69..6a0d3462a 100644 --- a/win32/src/PyWinTypes.h +++ b/win32/src/PyWinTypes.h @@ -69,10 +69,10 @@ typedef Py_ssize_t Py_hash_t; #include "mmsystem.h" #ifdef BUILD_PYWINTYPES -/* We are building pywintypesxx.dll */ +/* We are building pywintypesXX.dll */ #define PYWINTYPES_EXPORT __declspec(dllexport) #else -/* This module uses pywintypesxx.dll */ +/* This module uses pywintypesXX.dll */ #define PYWINTYPES_EXPORT __declspec(dllimport) #if defined(_MSC_VER) #if defined(DEBUG) || defined(_DEBUG) @@ -116,7 +116,7 @@ PYWINTYPES_EXPORT PyObject *PyWin_SetBasicCOMError(HRESULT hr); // ************* // strings, which are a bit of a mess! // -// This has gone from 2.x ascii-only, to 2.x+3.x ascii-or-unicode, to 3.x unicode-only, +// This has gone from Python 2 ascii-only, to Py2+Py3k ascii-or-unicode, to Python 3 unicode-only, // - this baggage means some strange APIs which convert to and from "char *" in various ways. // // A sizes/lengths are reported as a `DWORD` rather than a `Py_ssize_t`, that's what the callers diff --git a/win32/src/PyWinTypesmodule.cpp b/win32/src/PyWinTypesmodule.cpp index 76d8f9f38..a6a37318f 100644 --- a/win32/src/PyWinTypesmodule.cpp +++ b/win32/src/PyWinTypesmodule.cpp @@ -465,7 +465,7 @@ BOOL PyWinObject_AsDWORDArray(PyObject *obdwords, DWORD **pdwords, DWORD *item_c for (tuple_index = 0; tuple_index < *item_cnt; tuple_index++) { tuple_item = PyTuple_GET_ITEM(dwords_tuple, tuple_index); // Doesn't check for overflow, but will accept a python long - // greater than INT_MAX (even on python 2.3). Also accepts + // greater than INT_MAX (even on Python 2.3). Also accepts // negatives and converts to the correct hex representation (*pdwords)[tuple_index] = PyLong_AsUnsignedLongMask(tuple_item); if (((*pdwords)[tuple_index] == -1) && PyErr_Occurred()) { @@ -881,7 +881,7 @@ int PyWinGlobals_Ensure() // @tupleitem 3|None/int|argerror|The index of the argument in error, or (usually) None or -1 } - /* PyType_Ready *needs* to be called anytime pywintypesxx.dll is loaded, since + /* PyType_Ready *needs* to be called anytime pywintypesXX.dll is loaded, since other extension modules can use types defined here without pywintypes itself having been imported. ??? All extension modules that call this need to be changed to check the exit code ??? diff --git a/win32/src/_win32sysloader.cpp b/win32/src/_win32sysloader.cpp index c19a6dbb0..2a5db22ce 100644 --- a/win32/src/_win32sysloader.cpp +++ b/win32/src/_win32sysloader.cpp @@ -9,7 +9,7 @@ See pywintypes.py for more information. ********************************************************************/ #include "windows.h" -// Windows rpc.h defines "small" as "char" and Python 3.x's accu.h uses +// Windows rpc.h defines "small" as "char" and Python 3's accu.h uses // "small" as a structure element causing compilation errors :( #ifdef small #undef small diff --git a/win32/src/odbc.cpp b/win32/src/odbc.cpp index 01fe518fc..dfbe4c4fe 100644 --- a/win32/src/odbc.cpp +++ b/win32/src/odbc.cpp @@ -1606,7 +1606,7 @@ PYWIN_MODULE_INIT_FUNC(odbc) } /* Names of various sql datatypes. - 's' format of Py_BuildValue creates unicode on py3k, and char string on 2.x + 's' format of Py_BuildValue creates unicode on py3k, and char string on Python 2 */ char *szDbiString = "STRING"; char *szDbiRaw = "RAW"; diff --git a/win32/src/win32file.i b/win32/src/win32file.i index 361796441..e2b9d0823 100644 --- a/win32/src/win32file.i +++ b/win32/src/win32file.i @@ -709,7 +709,7 @@ static PyObject *PySetFileTime (PyObject *self, PyObject *args, PyObject *kwargs PyObject *obLastWriteTime = Py_None; // @pyparm |LastWriteTime|None|File written time. None for no change. BOOL UTCTimes = FALSE; // @pyparm boolean|UTCTimes|False|If True, input times are treated as UTC and no conversion is done, // otherwise they are treated as local times. Defaults to False for backward compatibility. - // This parameter is ignored in Python 3.x, where you should always pass datetime objects + // This parameter is ignored in Python 3, where you should always pass datetime objects // with timezone information. static char *keywords[] = {"File", "CreationTime", "LastAccessTime", "LastWriteTime", "UTCTimes", NULL}; diff --git a/win32/src/win32helpmodule.cpp b/win32/src/win32helpmodule.cpp index 31e8d6d4f..f9094b5ed 100644 --- a/win32/src/win32helpmodule.cpp +++ b/win32/src/win32helpmodule.cpp @@ -21,7 +21,7 @@ generates Windows .hlp files. #if _MSC_VER == 1500 // This uses htmlhelp.lib, which causes an unresolved external for -// __report_rangecheckfailure with vs2008 (which is what we used for python 2.x) +// __report_rangecheckfailure with vs2008 (which is what we used for Python 2) // No idea why, but we define it here and cause it to kill the process if it is ever hit. extern "C" __declspec(noreturn, dllexport) void __cdecl __report_rangecheckfailure(void) { ::ExitProcess(1); } #endif From abe8e15ccfeadc7e1cb03478c2483b62e2250b99 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 10 Aug 2023 14:09:18 -0400 Subject: [PATCH 2/2] SetApplicationName py.exe --- com/win32comext/taskscheduler/test/test_addtask_2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/com/win32comext/taskscheduler/test/test_addtask_2.py b/com/win32comext/taskscheduler/test/test_addtask_2.py index 5c2f7c8dd..b803db437 100644 --- a/com/win32comext/taskscheduler/test/test_addtask_2.py +++ b/com/win32comext/taskscheduler/test/test_addtask_2.py @@ -20,10 +20,9 @@ t = ts.NewWorkItem(task_name) t.SetComment("Test a task running as local system acct") -t.SetApplicationName("c:\\Python37\\python.exe") +t.SetApplicationName("py.exe") t.SetPriority(taskscheduler.REALTIME_PRIORITY_CLASS) t.SetParameters("test_localsystem.py") -t.SetWorkingDirectory("c:\\Python37") t.SetCreator("test_addtask_2.py") t.SetMaxRunTime(20000) # milliseconds t.SetFlags(taskscheduler.TASK_FLAG_DELETE_WHEN_DONE)