From 9521b2b71fc133ac4163b8e3bf55504f37ce77b5 Mon Sep 17 00:00:00 2001 From: ChrisTimperley Date: Mon, 1 Jun 2020 17:23:56 -0400 Subject: [PATCH] bug fix: lack of defensive copying leads to crash when shell is used with mappingproxy --- CHANGELOG.rst | 7 +++++++ src/dockerblade/shell.py | 2 +- src/dockerblade/version.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 418dfbd..e6d35b9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,10 @@ +v0.5.1 (2020-06-01) +------------------- + +* bug fix: lack of defensive copying in Shell constructor can lead to + crashes due to use of mappingproxy type. + + v0.5.0 (2020-05-29) ------------------- diff --git a/src/dockerblade/shell.py b/src/dockerblade/shell.py index 4b1b876..491ed67 100644 --- a/src/dockerblade/shell.py +++ b/src/dockerblade/shell.py @@ -85,6 +85,7 @@ class Shell: def __attrs_post_init__(self) -> None: object.__setattr__(self, '_sources', tuple(self._sources)) + object.__setattr__(self, '_environment', dict(self._environment)) if self._sources: filesystem = self.container.filesystem() @@ -312,7 +313,6 @@ def run(self, args_instrumented = self._instrument(args, time_limit=time_limit, kill_after=kill_after) - with Stopwatch() as timer: retcode, output_bin = docker_container.exec_run( args_instrumented, diff --git a/src/dockerblade/version.py b/src/dockerblade/version.py index 4543f94..8477183 100644 --- a/src/dockerblade/version.py +++ b/src/dockerblade/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '0.5.0' +__version__ = '0.5.1'