From 0bbc2bc6b2010ba40b156072fd26778be65b8ef4 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 14 Jan 2024 22:20:48 -0500 Subject: [PATCH] [Documentation] Fix lowercase DLL names and standardize uppercase `X` for variable version number (#2089) --- CHANGES.txt | 2 +- adodbapi/adodbapi.py | 2 +- adodbapi/apibase.py | 4 ++-- adodbapi/remote.py | 2 +- adodbapi/test/dbapi20.py | 4 ++-- com/pythoncom.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/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp | 2 +- com/win32comext/propsys/src/propsys.cpp | 4 ++-- pywin32_postinstall.py | 2 +- setup.py | 2 +- win32/Demos/c_extension/win32_extension.cpp | 2 +- win32/Demos/win32cred_demo.py | 2 +- win32/Lib/pywintypes.py | 4 ++-- win32/Lib/win32con.py | 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 +- 28 files changed, 42 insertions(+), 42 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index c31fd2dbe6..7a238523fb 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/adodbapi/adodbapi.py b/adodbapi/adodbapi.py index 36a2c88961..1dcca42c1f 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 d16265917f..19ae54814e 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 ae22b5a7ea..910c6b49a6 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 5f983cdc8d..2cd8335776 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 2180ecc32e..ef68dc6666 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/src/PythonCOMLoader.cpp b/com/win32com/src/PythonCOMLoader.cpp index daca9ac3ad..e9a149748b 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 e759971792..c8b7da82fa 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 a28bbc0d64..c6fad6c215 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 2ec6bc44b9..3f9a5f420a 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/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp b/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp index 548835d33f..707bd2a9d8 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 3172692c12..613f540fba 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 0662da56bf..19b971ba44 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 diff --git a/setup.py b/setup.py index 67d9396c59..d6553b2972 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/c_extension/win32_extension.cpp b/win32/Demos/c_extension/win32_extension.cpp index 8768424e39..eb1c91d531 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 3b49ca7c8f..c51cc7262a 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/Lib/pywintypes.py b/win32/Lib/pywintypes.py index 6839664f2c..14f9407c5a 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 @@ -56,7 +56,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 9916ba4aba..5e798ee293 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/scripts/regsetup.py b/win32/scripts/regsetup.py index 6d9ff6675c..da2f870e1d 100644 --- a/win32/scripts/regsetup.py +++ b/win32/scripts/regsetup.py @@ -503,7 +503,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, -pythonXX.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 caf10f9a7c..3673bb1266 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 5d751d87b1..de0c32cda4 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 34a3005789..5bb7b084dc 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 edfdb0b69a..6a0d3462a6 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 76d8f9f385..a6a37318fb 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 c19a6dbb03..2a5db22ce4 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 01fe518fc3..dfbe4c4fe1 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 3617964417..e2b9d0823f 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 31e8d6d4f9..f9094b5ed1 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