Add the msvcrt moduleto the default module deny list

Commit https://github.com/python/cpython/commit/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 bce3bab3e8)
pull/800/head
Alex Willmer 4 years ago
parent 965f9d6311
commit 8816ecaff0

@ -26,6 +26,7 @@ To avail of fixes in an unreleased version, please download a ZIP file
* :gh:issue:`758` fix initilialisation of callback plugins in test suite, to * :gh:issue:`758` fix initilialisation of callback plugins in test suite, to
to address a `KeyError` in to address a `KeyError` in
:method:`ansible.plugins.callback.CallbackBase.v2_runner_on_start` :method:`ansible.plugins.callback.CallbackBase.v2_runner_on_start`
* :gh:issue:`775` Add msvcrt to the default module deny list
v0.2.9 (2019-11-02) v0.2.9 (2019-11-02)

@ -1270,6 +1270,10 @@ class Importer(object):
'builtins', 'builtins',
'__builtin__', '__builtin__',
# On some Python releases (e.g. 3.8, 3.9) the subprocess module tries
# to import of this Windows-only builtin module.
'msvcrt',
# Python 2.x module that was renamed to _thread in 3.x. # Python 2.x module that was renamed to _thread in 3.x.
# This entry avoids a roundtrip on 2.x -> 3.x. # This entry avoids a roundtrip on 2.x -> 3.x.
'thread', 'thread',

Loading…
Cancel
Save