From c192a364f437dd0d000b9f0275dfbd1be31f975a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Andr=C3=A9s=20Margffoy=20Tuay?= Date: Fri, 4 Mar 2022 20:11:27 -0500 Subject: [PATCH 1/3] Update winpty-rs to v0.3.5 --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- Cargo.toml | 2 +- winpty/ptyprocess.py | 4 +++- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ddae5ac..b5372b86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] @@ -63,15 +63,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.102" +version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "parking_lot" @@ -118,9 +118,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] @@ -194,18 +194,18 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" dependencies = [ "bitflags", ] @@ -218,15 +218,15 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "smallvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "syn" -version = "1.0.76" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -247,9 +247,9 @@ checksum = "514672a55d7380da379785a4d70ca8386c8883ff7eaae877be4d2081cebe73d8" [[package]] name = "which" -version = "4.2.2" +version = "4.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" +checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2" dependencies = [ "either", "lazy_static", @@ -323,9 +323,9 @@ checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561" [[package]] name = "winpty-rs" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5fb57667d89f008aa2eddaf12c59e80b7457c974f2ef61f6f8f0cde491e0be" +checksum = "e482ef43363b1c252bd42d43f6ecb8b49a30425b7c7fd88e5092aa7f93f1eb84" dependencies = [ "bitflags", "enum-primitive-derive", diff --git a/Cargo.toml b/Cargo.toml index d2466f69..254f333f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ name = "winpty" crate-type = ["cdylib"] [dependencies] -winpty-rs = "0.3.4" +winpty-rs = "0.3.5" [dependencies.pyo3] version = "0.16.0" diff --git a/winpty/ptyprocess.py b/winpty/ptyprocess.py index 7cf4c8b8..55a98445 100644 --- a/winpty/ptyprocess.py +++ b/winpty/ptyprocess.py @@ -262,7 +262,9 @@ def isalive(self): exitstatus or signalstatus of the child. This returns True if the child process appears to be running or False if not. """ - return self.pty.isalive() + alive = self.pty.isalive() + self.closed = not alive + return alive def kill(self, sig=None): """Kill the process with the given signal. From 819edd1a710bd6f530e9de4e7d7ac945ceba906d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Andr=C3=A9s=20Margffoy=20Tuay?= Date: Fri, 4 Mar 2022 20:28:56 -0500 Subject: [PATCH 2/3] Try without cls --- winpty/tests/test_ptyprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winpty/tests/test_ptyprocess.py b/winpty/tests/test_ptyprocess.py index 0529a5b6..2fa5c3ee 100644 --- a/winpty/tests/test_ptyprocess.py +++ b/winpty/tests/test_ptyprocess.py @@ -102,7 +102,7 @@ def test_readline(pty_fixture): pty = pty_fixture(env=env) # Ensure that the echo print has its own CRLF - pty.write('cls\r\n') + # pty.write('cls\r\n') pty.write('echo %foo%\r\n') data = '' From 2dd9fcca294acfe331c8d94f65ce192d0bf1c623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Andr=C3=A9s=20Margffoy=20Tuay?= Date: Fri, 4 Mar 2022 20:56:21 -0500 Subject: [PATCH 3/3] Update to winpty-rs 0.3.6 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- winpty/tests/test_ptyprocess.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b5372b86..f32e0ab5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -323,9 +323,9 @@ checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561" [[package]] name = "winpty-rs" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e482ef43363b1c252bd42d43f6ecb8b49a30425b7c7fd88e5092aa7f93f1eb84" +checksum = "91417705e78856bcada689fe15e1bb435be89ed1b4972eb9962e048013d3742d" dependencies = [ "bitflags", "enum-primitive-derive", diff --git a/Cargo.toml b/Cargo.toml index 254f333f..6faa3a73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ name = "winpty" crate-type = ["cdylib"] [dependencies] -winpty-rs = "0.3.5" +winpty-rs = "0.3.6" [dependencies.pyo3] version = "0.16.0" diff --git a/winpty/tests/test_ptyprocess.py b/winpty/tests/test_ptyprocess.py index 2fa5c3ee..0529a5b6 100644 --- a/winpty/tests/test_ptyprocess.py +++ b/winpty/tests/test_ptyprocess.py @@ -102,7 +102,7 @@ def test_readline(pty_fixture): pty = pty_fixture(env=env) # Ensure that the echo print has its own CRLF - # pty.write('cls\r\n') + pty.write('cls\r\n') pty.write('echo %foo%\r\n') data = ''