Update to new upstream release 4.9.0 (#2251454)

This commit is contained in:
Dan Radez 2023-11-27 21:00:44 -05:00
parent c60697cac4
commit ae5fa3bc98
7 changed files with 8 additions and 459 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ pexpect-2.3.tar.gz
/pexpect-4.6.tar.gz /pexpect-4.6.tar.gz
/pexpect-4.7.0.tar.gz /pexpect-4.7.0.tar.gz
/pexpect-4.8.0.tar.gz /pexpect-4.8.0.tar.gz
/pexpect-4.9.0.tar.gz

View File

@ -1,270 +0,0 @@
From 31fab7b0edbe9b3401507b5dfa4db6aaf3fabca5 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Thu, 2 Feb 2023 19:59:38 -0500
Subject: [PATCH] tests: Replace deprecated unittest.makeSuite
This function was never formally documented, but has been deprecated and
will be removed in Python 3.13. Replaced with
unittest.TestLoader.loadTestsFromTestCase.
---
tests/deprecated_test_filedescriptor.py | 2 +-
tests/deprecated_test_run_out_of_pty.py | 2 +-
tests/test_ansi.py | 2 +-
tests/test_command_list_split.py | 2 +-
tests/test_constructor.py | 2 +-
tests/test_ctrl_chars.py | 2 +-
tests/test_destructor.py | 2 +-
tests/test_dotall.py | 2 +-
tests/test_expect.py | 2 +-
tests/test_filedescriptor.py | 2 +-
tests/test_interact.py | 2 +-
tests/test_isalive.py | 2 +-
tests/test_log.py | 2 +-
tests/test_misc.py | 2 +-
tests/test_missing_command.py | 2 +-
tests/test_performance.py | 2 +-
tests/test_popen_spawn.py | 2 +-
tests/test_screen.py | 2 +-
tests/test_socket.py | 2 +-
tests/test_timeout_pattern.py | 2 +-
tests/test_unicode.py | 2 +-
tests/test_winsize.py | 2 +-
22 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/tests/deprecated_test_filedescriptor.py b/tests/deprecated_test_filedescriptor.py
index 6b0ef3e8..cd930cfd 100755
--- a/tests/deprecated_test_filedescriptor.py
+++ b/tests/deprecated_test_filedescriptor.py
@@ -72,7 +72,7 @@ def test_fd_isatty (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ExpectTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ExpectTestCase)
#fout = open('delete_me_1','wb')
#fout.write(the_old_way)
diff --git a/tests/deprecated_test_run_out_of_pty.py b/tests/deprecated_test_run_out_of_pty.py
index 30901476..b34094e1 100755
--- a/tests/deprecated_test_run_out_of_pty.py
+++ b/tests/deprecated_test_run_out_of_pty.py
@@ -47,5 +47,5 @@ def OFF_test_run_out_of_pty (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ExpectTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ExpectTestCase)
diff --git a/tests/test_ansi.py b/tests/test_ansi.py
index 3d73fe8b..a49c6633 100755
--- a/tests/test_ansi.py
+++ b/tests/test_ansi.py
@@ -236,5 +236,5 @@ def test_decode_error(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ansiTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ansiTestCase)
diff --git a/tests/test_command_list_split.py b/tests/test_command_list_split.py
index 370f46e5..eeaf6c00 100755
--- a/tests/test_command_list_split.py
+++ b/tests/test_command_list_split.py
@@ -37,4 +37,4 @@ def testSplitSizes(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(SplitCommandLineTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(SplitCommandLineTestCase)
diff --git a/tests/test_constructor.py b/tests/test_constructor.py
index 98c473ae..1b4d7172 100755
--- a/tests/test_constructor.py
+++ b/tests/test_constructor.py
@@ -44,5 +44,5 @@ def test_named_parameters (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCaseConstructor,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseConstructor)
diff --git a/tests/test_ctrl_chars.py b/tests/test_ctrl_chars.py
index 032027c2..0719fc75 100755
--- a/tests/test_ctrl_chars.py
+++ b/tests/test_ctrl_chars.py
@@ -124,5 +124,5 @@ def test_sendcontrol(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCtrlChars,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCtrlChars)
diff --git a/tests/test_destructor.py b/tests/test_destructor.py
index d27b6f62..01d89a09 100755
--- a/tests/test_destructor.py
+++ b/tests/test_destructor.py
@@ -80,5 +80,5 @@ def test_destructor (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCaseDestructor,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseDestructor)
diff --git a/tests/test_dotall.py b/tests/test_dotall.py
index 68aef3f5..44c58c52 100755
--- a/tests/test_dotall.py
+++ b/tests/test_dotall.py
@@ -39,5 +39,5 @@ def test_precompiled (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCaseDotall,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseDotall)
diff --git a/tests/test_expect.py b/tests/test_expect.py
index 5e54d65c..919c98fd 100755
--- a/tests/test_expect.py
+++ b/tests/test_expect.py
@@ -714,4 +714,4 @@ def run(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ExpectTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ExpectTestCase)
diff --git a/tests/test_filedescriptor.py b/tests/test_filedescriptor.py
index d9164e1d..3f9d9546 100755
--- a/tests/test_filedescriptor.py
+++ b/tests/test_filedescriptor.py
@@ -69,4 +69,4 @@ def test_fileobj(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ExpectTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ExpectTestCase)
diff --git a/tests/test_interact.py b/tests/test_interact.py
index 4afbd18e..62b26035 100755
--- a/tests/test_interact.py
+++ b/tests/test_interact.py
@@ -97,5 +97,5 @@ def test_interact_exit_unicode(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(InteractTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(InteractTestCase)
diff --git a/tests/test_isalive.py b/tests/test_isalive.py
index 5e3021e8..ba2b5d4d 100755
--- a/tests/test_isalive.py
+++ b/tests/test_isalive.py
@@ -121,5 +121,5 @@ def test_expect_isalive_consistent_multiple_calls (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(IsAliveTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(IsAliveTestCase)
diff --git a/tests/test_log.py b/tests/test_log.py
index 4ad22569..e2defff3 100755
--- a/tests/test_log.py
+++ b/tests/test_log.py
@@ -104,5 +104,5 @@ def test_log_send_and_received (self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCaseLog,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseLog)
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 77847593..37a826ba 100755
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -370,4 +370,4 @@ def test_exception_tb(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCaseMisc,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseMisc)
diff --git a/tests/test_missing_command.py b/tests/test_missing_command.py
index 92e47335..37756322 100755
--- a/tests/test_missing_command.py
+++ b/tests/test_missing_command.py
@@ -34,5 +34,5 @@ def testMissingCommand(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(MissingCommandTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(MissingCommandTestCase)
diff --git a/tests/test_performance.py b/tests/test_performance.py
index d7e2cd6a..05027a0e 100755
--- a/tests/test_performance.py
+++ b/tests/test_performance.py
@@ -110,4 +110,4 @@ def test_large_stdout_stream(self):
if __name__ == "__main__":
unittest.main()
-suite = unittest.makeSuite(PerformanceTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(PerformanceTestCase)
diff --git a/tests/test_popen_spawn.py b/tests/test_popen_spawn.py
index fca7493d..96c795cb 100644
--- a/tests/test_popen_spawn.py
+++ b/tests/test_popen_spawn.py
@@ -136,4 +136,4 @@ def test_crlf_encoding(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ExpectTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ExpectTestCase)
diff --git a/tests/test_screen.py b/tests/test_screen.py
index 2429e57a..9e275bc4 100755
--- a/tests/test_screen.py
+++ b/tests/test_screen.py
@@ -282,6 +282,6 @@ def test_no_bytes(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(screenTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(screenTestCase)
diff --git a/tests/test_socket.py b/tests/test_socket.py
index a8c85956..548d90a6 100644
--- a/tests/test_socket.py
+++ b/tests/test_socket.py
@@ -277,4 +277,4 @@ def test_fileobj(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(ExpectTestCase, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(ExpectTestCase)
diff --git a/tests/test_timeout_pattern.py b/tests/test_timeout_pattern.py
index 5f610ef0..35d4816d 100755
--- a/tests/test_timeout_pattern.py
+++ b/tests/test_timeout_pattern.py
@@ -89,4 +89,4 @@ def nestedFunction (spawnInstance):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(Exp_TimeoutTestCase,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(Exp_TimeoutTestCase)
diff --git a/tests/test_unicode.py b/tests/test_unicode.py
index 9b5b988a..61031672 100644
--- a/tests/test_unicode.py
+++ b/tests/test_unicode.py
@@ -184,4 +184,4 @@ def test_unicode_argv(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(UnicodeTests, 'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(UnicodeTests)
diff --git a/tests/test_winsize.py b/tests/test_winsize.py
index be16773b..6fc78cef 100755
--- a/tests/test_winsize.py
+++ b/tests/test_winsize.py
@@ -55,6 +55,6 @@ def test_setwinsize(self):
if __name__ == '__main__':
unittest.main()
-suite = unittest.makeSuite(TestCaseWinsize,'test')
+suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseWinsize)

View File

@ -1,22 +0,0 @@
From 373679020c6b1875293bf0e3a26d3116d605bff8 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Sun, 12 Feb 2023 21:34:51 -0500
Subject: [PATCH] Fix SyntaxWarning in fakessh by using raw string
---
tests/fakessh/ssh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/fakessh/ssh b/tests/fakessh/ssh
index 4a5be1bd..74ffe20c 100755
--- a/tests/fakessh/ssh
+++ b/tests/fakessh/ssh
@@ -62,7 +62,7 @@ prompt = "$"
while True:
cmd = input(prompt)
if cmd.startswith('PS1='):
- prompt = eval(cmd[4:]).replace('\$', '$')
+ prompt = eval(cmd[4:]).replace(r'\$', '$')
elif cmd == 'ping':
print('pong')
elif cmd.startswith('ls'):

View File

@ -1,67 +0,0 @@
From 52af5b0ae0627139524448a3f2e83d9f40802bc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 24 Mar 2022 15:15:33 +0100
Subject: [PATCH] Convert @asyncio.coroutine to async def
This is required for Python 3.11+ support.
Fixes https://github.com/pexpect/pexpect/issues/677
---
pexpect/_async.py | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/pexpect/_async.py b/pexpect/_async.py
index dfbfeef5..bc83261d 100644
--- a/pexpect/_async.py
+++ b/pexpect/_async.py
@@ -4,8 +4,7 @@
from pexpect import EOF
-@asyncio.coroutine
-def expect_async(expecter, timeout=None):
+async def expect_async(expecter, timeout=None):
# First process data that was previously read - if it maches, we don't need
# async stuff.
idx = expecter.existing_data()
@@ -14,7 +13,7 @@ def expect_async(expecter, timeout=None):
if not expecter.spawn.async_pw_transport:
pw = PatternWaiter()
pw.set_expecter(expecter)
- transport, pw = yield from asyncio.get_event_loop()\
+ transport, pw = await asyncio.get_event_loop()\
.connect_read_pipe(lambda: pw, expecter.spawn)
expecter.spawn.async_pw_transport = pw, transport
else:
@@ -22,26 +21,25 @@ def expect_async(expecter, timeout=None):
pw.set_expecter(expecter)
transport.resume_reading()
try:
- return (yield from asyncio.wait_for(pw.fut, timeout))
+ return (await asyncio.wait_for(pw.fut, timeout))
except asyncio.TimeoutError as e:
transport.pause_reading()
return expecter.timeout(e)
-@asyncio.coroutine
-def repl_run_command_async(repl, cmdlines, timeout=-1):
+async def repl_run_command_async(repl, cmdlines, timeout=-1):
res = []
repl.child.sendline(cmdlines[0])
for line in cmdlines[1:]:
- yield from repl._expect_prompt(timeout=timeout, async_=True)
+ await repl._expect_prompt(timeout=timeout, async_=True)
res.append(repl.child.before)
repl.child.sendline(line)
# Command was fully submitted, now wait for the next prompt
- prompt_idx = yield from repl._expect_prompt(timeout=timeout, async_=True)
+ prompt_idx = await repl._expect_prompt(timeout=timeout, async_=True)
if prompt_idx == 1:
# We got the continuation prompt - command was incomplete
repl.child.kill(signal.SIGINT)
- yield from repl._expect_prompt(timeout=1, async_=True)
+ await repl._expect_prompt(timeout=1, async_=True)
raise ValueError("Continuation prompt found - input was incomplete:")
return u''.join(res + [repl.child.before])

View File

@ -1,93 +0,0 @@
From dae602d37493bae239e0e8db5b3dabafebfd59db Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Wed, 1 Feb 2023 22:38:53 -0500
Subject: [PATCH] tests: Replace assertRaisesRegexp with assertRaisesRegex
unittest.TestCase.assertRaisesRegexp was deprecated in Python 3.2 and is
removed in Python 3.12.
---
tests/PexpectTestCase.py | 2 +-
tests/test_expect.py | 8 ++++----
tests/test_misc.py | 4 ++--
tests/test_popen_spawn.py | 8 ++++----
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/tests/PexpectTestCase.py b/tests/PexpectTestCase.py
index 307437ef..5d7a1684 100644
--- a/tests/PexpectTestCase.py
+++ b/tests/PexpectTestCase.py
@@ -97,7 +97,7 @@ def assertRaises(self, excClass):
raise AssertionError("%s was not raised" % excClass)
@contextlib.contextmanager
- def assertRaisesRegexp(self, excClass, pattern):
+ def assertRaisesRegex(self, excClass, pattern):
import re
try:
yield
diff --git a/tests/test_expect.py b/tests/test_expect.py
index 5e54d65c..be6078c4 100755
--- a/tests/test_expect.py
+++ b/tests/test_expect.py
@@ -643,13 +643,13 @@ def test_greed_exact(self):
def test_bad_arg(self):
p = pexpect.spawn('cat')
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect(1)
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect([1, b'2'])
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect_exact(1)
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect_exact([1, b'2'])
def test_timeout_none(self):
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 77847593..3dc2b6ec 100755
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -214,7 +214,7 @@ def test_bad_child_pid(self):
# Force an invalid state to test isalive
child.ptyproc.terminated = 0
try:
- with self.assertRaisesRegexp(pexpect.ExceptionPexpect,
+ with self.assertRaisesRegex(pexpect.ExceptionPexpect,
".*" + expect_errmsg):
child.isalive()
finally:
@@ -224,7 +224,7 @@ def test_bad_child_pid(self):
def test_bad_arguments_suggest_fdpsawn(self):
" assert custom exception for spawn(int). "
expect_errmsg = "maybe you want to use fdpexpect.fdspawn"
- with self.assertRaisesRegexp(pexpect.ExceptionPexpect,
+ with self.assertRaisesRegex(pexpect.ExceptionPexpect,
".*" + expect_errmsg):
pexpect.spawn(1)
diff --git a/tests/test_popen_spawn.py b/tests/test_popen_spawn.py
index fca7493d..10d70326 100644
--- a/tests/test_popen_spawn.py
+++ b/tests/test_popen_spawn.py
@@ -110,13 +110,13 @@ def test_unexpected_eof(self):
def test_bad_arg(self):
p = PopenSpawn('cat')
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect(1)
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect([1, b'2'])
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect_exact(1)
- with self.assertRaisesRegexp(TypeError, '.*must be one of'):
+ with self.assertRaisesRegex(TypeError, '.*must be one of'):
p.expect_exact([1, b'2'])
def test_timeout_none(self):

View File

@ -4,8 +4,8 @@
Name: python-%{modname} Name: python-%{modname}
Summary: Unicode-aware Pure Python Expect-like module Summary: Unicode-aware Pure Python Expect-like module
Version: 4.8.0 Version: 4.9.0
Release: 17%{?dist} Release: 1%{?dist}
# All the files have ISC license except the # All the files have ISC license except the
# following two that have BSD license: # following two that have BSD license:
@ -14,10 +14,6 @@ Release: 17%{?dist}
License: ISC AND BSD-3-Clause License: ISC AND BSD-3-Clause
URL: https://github.com/pexpect/pexpect URL: https://github.com/pexpect/pexpect
Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
Patch0: %{url}/pull/715/commits/52af5b0ae0627139524448a3f2e83d9f40802bc2.patch
Patch1: %{url}/pull/737/commits/dae602d37493bae239e0e8db5b3dabafebfd59db.patch
Patch2: %{url}/pull/739/commits/31fab7b0edbe9b3401507b5dfa4db6aaf3fabca5.patch
Patch3: %{url}/pull/742/commits/373679020c6b1875293bf0e3a26d3116d605bff8.patch
BuildRequires: /usr/bin/man BuildRequires: /usr/bin/man
%if %{with check} %if %{with check}
@ -49,6 +45,7 @@ BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-pytest BuildRequires: python3-pytest
BuildRequires: python3-ptyprocess BuildRequires: python3-ptyprocess
BuildRequires: zsh
Requires: python3-ptyprocess Requires: python3-ptyprocess
%description -n python3-%{modname} %description -n python3-%{modname}
@ -100,6 +97,9 @@ TRAVIS=true py.test-3 --verbose
%{python3_sitelib}/%{modname}-*.egg-info %{python3_sitelib}/%{modname}-*.egg-info
%changelog %changelog
* Mon Nov 27 2023 Dan Radez <dradez@redhat.com> - 4.9.0-1
- Update to new upstream release 4.9.0 (#2251454)
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-17 * Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (pexpect-4.8.0.tar.gz) = f141e1368ceea15209b04555a524443cd9cf36d4a3677b63f7a2b079d41aae3fb8656612772732f4097b803c55a05f9bb7e3b427d11ae5357666406669ae6867 SHA512 (pexpect-4.9.0.tar.gz) = bc18a0827e9ab034e2fd010291261cdbda42dab02c6216d097b7569d22688327bac20aa03c8c0826728c9f7ae2a20cd7f673b107aaa4017232141dca1a3fc75b