summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-12-10 16:56:37 (GMT)
committerGitHub <noreply@github.com>2018-12-10 16:56:37 (GMT)
commitf55f43e11f7f7efc96d17aeda8e0fef4f09ce627 (patch)
tree1c4a49529c58dff6d895a89e444e03c89bb0d5ca
parentb12d5aa0d3f2fbef3d9ae741ddf9867d38df24b1 (diff)
parent98b807225bfe0a173be07e6b454372cee022ab16 (diff)
downloadSCons-f55f43e11f7f7efc96d17aeda8e0fef4f09ce627.zip
SCons-f55f43e11f7f7efc96d17aeda8e0fef4f09ce627.tar.gz
SCons-f55f43e11f7f7efc96d17aeda8e0fef4f09ce627.tar.bz2
Merge pull request #3245 from bdbaddog/fix_gh_3136_py3_modified_io_class_breaks
Fix GH issue #3136 No need to explicitly set file handles to non-sharable. Py 3.4 and above do this by default
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Platform/win32.py12
2 files changed, 5 insertions, 10 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index bae54d5..76d3197 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -55,6 +55,9 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
yielded trying to combine strings and bytes which threw exception.
- Fix GH Issue #3225 SCons.Util.Flatten() doesn't handle MappingView's produced by dictionary as return
values from dict().{items(), keys(), values()}.
+ - Fix GH Issue #3136 no longer wrap io.{BufferedReader,BufferedWriter,BufferedRWPair,BufferedRandom,TextIOWrapper
+ with logic to set HANDLE_FLAG_INHERIT flag on the file handle. Python 3.4+ automatically sets this according
+ to Python docs: https://docs.python.org/3/library/os.html#fd-inheritance
From Andrew Featherstone
- Removed unused --warn options from the man page and source code.
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py
index 3b76208..2d40fb8 100644
--- a/src/engine/SCons/Platform/win32.py
+++ b/src/engine/SCons/Platform/win32.py
@@ -82,16 +82,8 @@ else:
win32con.HANDLE_FLAG_INHERIT, 0)
file = _scons_file
else:
- import io
- for io_class in ['BufferedReader', 'BufferedWriter', 'BufferedRWPair',
- 'BufferedRandom', 'TextIOWrapper']:
- _builtin_file = getattr(io, io_class)
- class _scons_file(_builtin_file):
- def __init__(self, *args, **kw):
- _builtin_file.__init__(self, *args, **kw)
- win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
- win32con.HANDLE_FLAG_INHERIT, 0)
- setattr(io, io_class, _scons_file)
+ # No longer needed for python 3.4 and above. Files are opened non sharable
+ pass