Skip to content

Commit 8816eca

Browse files
committed
Add the msvcrt moduleto the default module deny list
Commit python/cpython@880d42a3b247 (first released in Python 3.8a0) moved an import of msvcrt from an if <win32> block, into a try/except block. So now the import is tried even on Linux or MacOS. https://docs.python.org/3/library/msvcrt.html is a Windows specific builtin. (cherry picked from commit bce3bab)
1 parent 965f9d6 commit 8816eca

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ To avail of fixes in an unreleased version, please download a ZIP file
2626
* :gh:issue:`758` fix initilialisation of callback plugins in test suite, to
2727
to address a `KeyError` in
2828
:method:`ansible.plugins.callback.CallbackBase.v2_runner_on_start`
29+
* :gh:issue:`775` Add msvcrt to the default module deny list
2930

3031

3132
v0.2.9 (2019-11-02)

mitogen/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,10 @@ class Importer(object):
12701270
'builtins',
12711271
'__builtin__',
12721272

1273+
# On some Python releases (e.g. 3.8, 3.9) the subprocess module tries
1274+
# to import of this Windows-only builtin module.
1275+
'msvcrt',
1276+
12731277
# Python 2.x module that was renamed to _thread in 3.x.
12741278
# This entry avoids a roundtrip on 2.x -> 3.x.
12751279
'thread',

0 commit comments

Comments
 (0)