Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] Fix lowercase DLL names and standardize uppercase X for variable version number #2089

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion adodbapi/adodbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions adodbapi/apibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion adodbapi/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions adodbapi/test/dbapi20.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion com/pythoncom.py
Original file line number Diff line number Diff line change
@@ -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())
6 changes: 3 additions & 3 deletions com/win32com/src/PythonCOMLoader.cpp
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/src/include/PythonCOM.h
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/src/oleargs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/test/testGIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions com/win32comext/propsys/src/propsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <om
// @pyparm buffer|ps||Bytes or buffer (or str in Python 2) containing a serialized property set (see <om
// PyIPersistSerializedPropStorage.GetPropertyStorage>)
// @pyparm <o PyPROPERTYKEY>|key||Property to return
if (!PyArg_ParseTuple(args, "OO&:PSGetPropertyFromPropertyStorage", &obbuf, PyWinObject_AsPROPERTYKEY, &key))
Expand All @@ -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 <om
// @pyparm buffer|ps||Bytes or buffer (or str in Python 2) containing a serialized property set (see <om
// PyIPersistSerializedPropStorage.GetPropertyStorage>)
// @pyparm str|name||Property to return
if (!PyArg_ParseTuple(args, "OO:PSGetNamedPropertyFromPropertyStorage", &obbuf, &obname))
Expand Down
3 changes: 1 addition & 2 deletions com/win32comext/taskscheduler/test/test_addtask_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pywin32_postinstall.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion win32/Demos/c_extension/win32_extension.cpp
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
2 changes: 1 addition & 1 deletion win32/Demos/win32cred_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions win32/Lib/pywintypes.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion win32/Lib/win32con.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion win32/scripts/regsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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
Expand Down
4 changes: 2 additions & 2 deletions win32/scripts/setup_d.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion win32/src/PyTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
6 changes: 3 additions & 3 deletions win32/src/PyUnicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down
6 changes: 3 additions & 3 deletions win32/src/PyWinTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions win32/src/PyWinTypesmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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 ???
Expand Down
2 changes: 1 addition & 1 deletion win32/src/_win32sysloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion win32/src/odbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion win32/src/win32file.i
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ static PyObject *PySetFileTime (PyObject *self, PyObject *args, PyObject *kwargs
PyObject *obLastWriteTime = Py_None; // @pyparm <o PyDateTime>|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};
Expand Down
2 changes: 1 addition & 1 deletion win32/src/win32helpmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down