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

2.7.18.10 dev #60

Draft
wants to merge 11 commits into
base: 2.7.18.x
Choose a base branch
from
Draft
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: 2 additions & 0 deletions Doc/library/codecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,8 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| cp1258 | windows-1258 | Vietnamese |
+-----------------+--------------------------------+--------------------------------+
| cp65001 | | Alias to ``utf_8`` encoding |
+-----------------+--------------------------------+--------------------------------+
| euc_jp | eucjp, ujis, u-jis | Japanese |
+-----------------+--------------------------------+--------------------------------+
| euc_jis_2004 | jisx0213, eucjis2004 | Japanese |
Expand Down
2 changes: 1 addition & 1 deletion Include/patchlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define PY_RELEASE_SERIAL 0

/* Version as a string */
#define PY_VERSION "2.7.18.9"
#define PY_VERSION "2.7.18.10"
/*--end constants--*/

/* Subversion Revision number of this file (not of the repository). Empty
Expand Down
6 changes: 5 additions & 1 deletion Lib/ctypes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def _get_build_version():
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
majorVersion += 1
Comment on lines +22 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the comment in all the other places this was done. Still not sure I understand it, but a reason was given.

minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
Expand All @@ -36,8 +38,10 @@ def find_msvcrt():
return None
if version <= 6:
clibname = 'msvcrt'
else:
elif version <= 13:
clibname = 'msvcr%d' % (version * 10)
else:
clibname = 'appcrt%d' % (version * 10)

# If python was built with in debug mode
import imp
Expand Down
4 changes: 2 additions & 2 deletions Lib/distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ def finalize_options(self):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
if MSVC_VERSION == 9:
if MSVC_VERSION >= 9:
# Use the .lib files for the correct architecture
if self.plat_name == 'win32':
suffix = ''
suffix = 'win32'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves suffix undefined in certain circumstances.

else:
# win-amd64 or win-ia64
suffix = self.plat_name[4:]
Expand Down
12 changes: 8 additions & 4 deletions Lib/distutils/msvc9compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ def get_build_version():
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
# v13 was skipped and should be v14
majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
Expand Down Expand Up @@ -716,11 +719,12 @@ def link(self,
if mfinfo is not None:
mffilename, mfid = mfinfo
out_arg = '-outputresource:%s;%s' % (output_filename, mfid)
try:
self.spawn(['mt.exe', '-nologo', '-manifest',
if self.__version < 10:
try:
self.spawn(['mt.exe', '-nologo', '-manifest',
mffilename, out_arg])
except DistutilsExecError, msg:
raise LinkError(msg)
except DistutilsExecError, msg:
raise LinkError(msg)
else:
log.debug("skipping %s (up-to-date)", output_filename)

Expand Down
3 changes: 3 additions & 0 deletions Lib/distutils/msvccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def get_build_version():
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
# v13 was skipped and should be v14
majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
Expand Down
1 change: 1 addition & 0 deletions Lib/encodings/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@
'utf8' : 'utf_8',
'utf8_ucs2' : 'utf_8',
'utf8_ucs4' : 'utf_8',
'cp65001' : 'utf_8',

# uu_codec codec
'uu' : 'uu_codec',
Expand Down
43 changes: 43 additions & 0 deletions Misc/NEWS.d/2.7.18.10.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.. bpo: none
.. date: 2024-08-08
.. nonce:
.. release date: 2024-08-08
.. section: Core and Builtins

Relocate vcruntime140.dll to Python executable folder.

vcruntime140.dll has been moved to the same directory as Python.exe.

.. bpo: none
.. date: 2024-08-08
.. nonce:
.. release date: 2024-06-26
.. section: Core and Builtins

WSA Errors are handled on Unix

We now convert WSAE* errors to unix equvalents if they are not supported.

.. bpo: 36778
.. date: 2019-05-10
.. nonce:
.. release date: 2024-06-06
.. section: Core and Builtins

Handle Windows code page 65001

``cp65001`` encoding (Windows code page 65001) becomes an alias to ``utf_8``
encoding.

.. gh: 114315
.. date: 2024-06-27
.. nonce:
.. release date: 2024-08-08
.. section: Core and Builtins

CVE-2024-0397 Fix locking in cert_store_stats and get_ca_certs

:meth:`ssl.SSLContext.cert_store_stats` and
:meth:`ssl.SSLContext.get_ca_certs` now correctly lock access to the
certificate store, when the :class:`ssl.SSLContext` is shared across
multiple threads.
27 changes: 27 additions & 0 deletions Modules/errnomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@
/* Windows socket errors (WSA*) */
#ifdef MS_WINDOWS
#include <windows.h>
/* The following constants were added to errno.h in VS2010 but have
preferred WSA equivalents. */
#undef EADDRINUSE
#undef EADDRNOTAVAIL
#undef EAFNOSUPPORT
#undef EALREADY
#undef ECONNABORTED
#undef ECONNREFUSED
#undef ECONNRESET
#undef EDESTADDRREQ
#undef EHOSTUNREACH
#undef EINPROGRESS
#undef EISCONN
#undef ELOOP
#undef EMSGSIZE
#undef ENETDOWN
#undef ENETRESET
#undef ENETUNREACH
#undef ENOBUFS
#undef ENOPROTOOPT
#undef ENOTCONN
#undef ENOTSOCK
#undef EOPNOTSUPP
#undef EPROTONOSUPPORT
#undef EPROTOTYPE
#undef ETIMEDOUT
#undef EWOULDBLOCK
#endif

/*
Expand Down
56 changes: 56 additions & 0 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,62 @@ static PyMethodDef functions[] = {
if (PyDict_SetItemString(bdict, # TYPE, PyExc_ ## TYPE)) \
Py_FatalError("Module dictionary insertion problem.");

#ifdef MS_WINDOWS
#include <Winsock2.h>
/* The following constants were added to errno.h in VS2010 but have
preferred WSA equivalents. */
#undef EADDRINUSE
#undef EADDRNOTAVAIL
#undef EAFNOSUPPORT
#undef EALREADY
#undef ECONNABORTED
#undef ECONNREFUSED
#undef ECONNRESET
#undef EDESTADDRREQ
#undef EHOSTUNREACH
#undef EINPROGRESS
#undef EISCONN
#undef ELOOP
#undef EMSGSIZE
#undef ENETDOWN
#undef ENETRESET
#undef ENETUNREACH
#undef ENOBUFS
#undef ENOPROTOOPT
#undef ENOTCONN
#undef ENOTSOCK
#undef EOPNOTSUPP
#undef EPROTONOSUPPORT
#undef EPROTOTYPE
#undef ETIMEDOUT
#undef EWOULDBLOCK

#if defined(WSAEALREADY) && !defined(EALREADY)
#define EALREADY WSAEALREADY
#endif
#if defined(WSAECONNABORTED) && !defined(ECONNABORTED)
#define ECONNABORTED WSAECONNABORTED
#endif
#if defined(WSAECONNREFUSED) && !defined(ECONNREFUSED)
#define ECONNREFUSED WSAECONNREFUSED
#endif
#if defined(WSAECONNRESET) && !defined(ECONNRESET)
#define ECONNRESET WSAECONNRESET
#endif
#if defined(WSAEINPROGRESS) && !defined(EINPROGRESS)
#define EINPROGRESS WSAEINPROGRESS
#endif
#if defined(WSAESHUTDOWN) && !defined(ESHUTDOWN)
#define ESHUTDOWN WSAESHUTDOWN
#endif
#if defined(WSAETIMEDOUT) && !defined(ETIMEDOUT)
#define ETIMEDOUT WSAETIMEDOUT
#endif
#if defined(WSAEWOULDBLOCK) && !defined(EWOULDBLOCK)
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
#endif /* MS_WINDOWS */


PyMODINIT_FUNC
_PyExc_Init(void)
Expand Down
29 changes: 6 additions & 23 deletions PC/bdist_wininst/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ static void CenterWindow(HWND hwnd)

#include <prsht.h>

BOOL CALLBACK
INT_PTR CALLBACK
IntroDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -1534,7 +1534,7 @@ SCHEME *GetScheme(int major, int minor)
return old_scheme;
}

BOOL CALLBACK
INT_PTR CALLBACK
SelectPythonDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -1836,7 +1836,7 @@ static void CloseLogfile(void)
fclose(logfile);
}

BOOL CALLBACK
INT_PTR CALLBACK
InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -1991,7 +1991,7 @@ InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}


BOOL CALLBACK
INT_PTR CALLBACK
FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -2167,23 +2167,6 @@ BOOL NeedAutoUAC()
return TRUE;
}

// Returns TRUE if the platform supports UAC.
BOOL PlatformSupportsUAC()
{
// Note that win2k does seem to support ShellExecute with 'runas',
// but does *not* support IsUserAnAdmin - so we just pretend things
// only work on XP and later.
BOOL bIsWindowsXPorLater;
OSVERSIONINFO winverinfo;
winverinfo.dwOSVersionInfoSize = sizeof(winverinfo);
if (!GetVersionEx(&winverinfo))
return FALSE; // something bad has gone wrong
bIsWindowsXPorLater =
( (winverinfo.dwMajorVersion > 5) ||
( (winverinfo.dwMajorVersion == 5) && (winverinfo.dwMinorVersion >= 1) ));
return bIsWindowsXPorLater;
}

// Spawn ourself as an elevated application. On failure, a message is
// displayed to the user - but this app will always terminate, even
// on error.
Expand Down Expand Up @@ -2239,15 +2222,15 @@ int DoInstall(void)

// See if we need to do the Vista UAC magic.
if (strcmp(user_access_control, "force")==0) {
if (PlatformSupportsUAC() && !MyIsUserAnAdmin()) {
if (!MyIsUserAnAdmin()) {
SpawnUAC();
return 0;
}
// already admin - keep going
} else if (strcmp(user_access_control, "auto")==0) {
// Check if it looks like we need UAC control, based
// on how Python itself was installed.
if (PlatformSupportsUAC() && !MyIsUserAnAdmin() && NeedAutoUAC()) {
if (!MyIsUserAnAdmin() && NeedAutoUAC()) {
SpawnUAC();
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions PC/layout/support/python.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<Target Name="$$PYTHON_TARGET$$" Returns="@(PythonRuntime)">
<ItemGroup>
<_PythonRuntimeExe Include="$(PythonHome)\python*.dll" />
<_PythonRuntimeExe Include="$(PythonHome)\vcruntime*.dll" />
<_PythonRuntimeExe Include="$(PythonHome)\python*.exe" Condition="$(IncludePythonExe) == 'true'" />
<_PythonRuntimeExe>
<Link>%(Filename)%(Extension)</Link>
Expand Down
15 changes: 14 additions & 1 deletion PC/msvcrtmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#ifdef _MSC_VER
#if _MSC_VER >= 1500 && _MSC_VER < 1600
#include <crtassem.h>
#elif _MSC_VER >= 1600
#include <crtversion.h>
#endif
#endif

Expand Down Expand Up @@ -397,7 +399,7 @@ PyMODINIT_FUNC
initmsvcrt(void)
{
int st;
PyObject *d;
PyObject *d, *version;
PyObject *m = Py_InitModule("msvcrt", msvcrt_functions);
if (m == NULL)
return;
Expand All @@ -411,6 +413,7 @@ initmsvcrt(void)
insertint(d, "LK_UNLCK", _LK_UNLCK);

/* constants for the crt versions */
(void)st;
#ifdef _VC_ASSEMBLY_PUBLICKEYTOKEN
st = PyModule_AddStringConstant(m, "VC_ASSEMBLY_PUBLICKEYTOKEN",
_VC_ASSEMBLY_PUBLICKEYTOKEN);
Expand All @@ -426,4 +429,14 @@ initmsvcrt(void)
__LIBRARIES_ASSEMBLY_NAME_PREFIX);
if (st < 0)return;
#endif

/* constants for the 2010 crt versions */
#if defined(_VC_CRT_MAJOR_VERSION) && defined (_VC_CRT_MINOR_VERSION) && defined(_VC_CRT_BUILD_VERSION) && defined(_VC_CRT_RBUILD_VERSION)
version = PyUnicode_FromFormat("%d.%d.%d.%d", _VC_CRT_MAJOR_VERSION,
_VC_CRT_MINOR_VERSION,
_VC_CRT_BUILD_VERSION,
_VC_CRT_RBUILD_VERSION);
st = PyModule_AddObject(m, "CRT_ASSEMBLY_VERSION", version);
if (st < 0) return NULL;
#endif
}
1 change: 0 additions & 1 deletion PCbuild/_bsddb.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1e180000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_ctypes.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<AdditionalIncludeDirectories>..\Modules\_ctypes\libffi_msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<BaseAddress>0x1D1A0000</BaseAddress>
<AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
Expand Down
3 changes: 0 additions & 3 deletions PCbuild/_elementtree.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
<AdditionalIncludeDirectories>..\Modules\expat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<BaseAddress>0x1D100000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Modules\expat\ascii.h" />
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_msi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1D160000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
Loading