Accepting request 1128703 from devel:languages:python

- update to 4.9:
  * Add support for Python 3.12 #769.
  * Clean up temporary files after UnicodeTests #753.
  * Add Python 3.5, 3.6 and 3.12.0-rc.1 to test matrix #763.
  * Set prompt correctly for zsh #712.
  * Add zsh convenience function to replwrap module #751.
  * Rework async unittests to rely on
    unittest.IsolatedAsyncioTestCase #764.
  * Make test_expect.py work on POSIX systems that are not Linux
    based #698.
  * Add support for ``socket``, which allows sockets to be used
    crossplatform #745.
  * Update async to work on newer versions of python #732.
  * Remove deprecated RSAAuthentication option (SSHv1) #744.
  * Multiple CI fixes #743 #737 #742 #739 #722.
  * Use Github Actions for CI #734.
  * Remove pytest-capturelog from testing requirements #730.
  * Fix usage for Solaris #663 #604 #560.
  * Fix threading for new versions of python #684.
  * Fix documentation builds for use with Sphinx 3 #638.
  * Use ``sys.executable`` for tests and wrapper, allowing the
    calling python executable to be used instead #623.
  * Update documentation about Wexpect #623.
  * Added project urls to ``setup.py`` #620.
  * Provide examples for how to use Pexpect and Pyte #587.
  * Coerce compiled regex patterns type according to spawn
    encoding #560.
  * Several doc updates #626 #635 #643 #644 #728.
  drop 31fab7b0edbe9b3401507b5dfa4db6aaf3fabca5.patch,
       684.patch, 715.patch, 742.patch,

OBS-URL: https://build.opensuse.org/request/show/1128703
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pexpect?expand=0&rev=46
This commit is contained in:
Ana Guerrero 2023-11-26 18:36:37 +00:00 committed by Git OBS Bridge
commit 0ab7410214
11 changed files with 44 additions and 624 deletions

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,23 +0,0 @@
From 0bc643ea88748e08a095e3f1a43480c9113d45b8 Mon Sep 17 00:00:00 2001
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Date: Sat, 17 Apr 2021 08:10:37 +0000
Subject: [PATCH] Set daemon attribute instead of using setDaemon method that
was deprecated in Python 3.10
---
pexpect/popen_spawn.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pexpect/popen_spawn.py b/pexpect/popen_spawn.py
index 4bb58cfe..e6bdf07d 100644
--- a/pexpect/popen_spawn.py
+++ b/pexpect/popen_spawn.py
@@ -57,7 +57,7 @@ def __init__(self, cmd, timeout=30, maxread=2000, searchwindowsize=None,
self._read_queue = Queue()
self._read_thread = threading.Thread(target=self._read_incoming)
- self._read_thread.setDaemon(True)
+ self._read_thread.daemon = True
self._read_thread.start()
_read_reached_eof = False

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,13 +0,0 @@
Index: pexpect-4.8.0/tests/fakessh/ssh
===================================================================
--- pexpect-4.8.0.orig/tests/fakessh/ssh
+++ pexpect-4.8.0/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,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

@ -1,36 +0,0 @@
From 000a8684bd109c3f9c9b5fabd95add4743b7f45a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20E=C3=9Fer?= <se@FreeBSD.org>
Date: Wed, 22 Sep 2021 17:48:07 +0200
Subject: [PATCH] Do not fail if no alias has been defined
Upstream: merged (https://github.com/pexpect/pexpect/pull/698/commits/000a8684bd109c3f9c9b5fabd95add4743b7f45a)
There is no output if no alias has been defined and the test fails in
that case. Adding an alias definition makes the alias command return
at least that just added entry.
---
tests/test_replwrap.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/test_replwrap.py b/tests/test_replwrap.py
index 5e50ea28..73c82e84 100644
--- a/tests/test_replwrap.py
+++ b/tests/test_replwrap.py
@@ -25,7 +25,7 @@ def tearDown(self):
def test_bash(self):
bash = replwrap.bash()
- res = bash.run_command("alias")
+ res = bash.run_command("alias xyzzy=true; alias")
assert 'alias' in res, res
try:
@@ -92,7 +92,9 @@ def test_existing_spawn(self):
"PS1='{0}' PS2='{1}' "
"PROMPT_COMMAND=''")
+ print(repl)
res = repl.run_command("echo $HOME")
+ print(res)
assert res.startswith('/'), res
def test_python(self):

View File

@ -1,96 +0,0 @@
Index: pexpect-4.8.0/tests/test_performance.py
===================================================================
--- pexpect-4.8.0.orig/tests/test_performance.py
+++ pexpect-4.8.0/tests/test_performance.py
@@ -45,7 +45,7 @@ class PerformanceTestCase (PexpectTestCa
return 'for n in range(1, %d+1): print(n)' % n
def plain_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect(br'\.{3}'), 0)
@@ -53,7 +53,7 @@ class PerformanceTestCase (PexpectTestCa
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
def window_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect(r'\.{3}'), 0)
@@ -61,7 +61,7 @@ class PerformanceTestCase (PexpectTestCa
self.assertEqual(e.expect([b'inquisition', '%d' % n], searchwindowsize=20), 1)
def exact_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect_exact([b'>>>']), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect_exact([b'...']), 0)
@@ -69,7 +69,7 @@ class PerformanceTestCase (PexpectTestCa
self.assertEqual(e.expect_exact([b'inquisition', '%d' % n],timeout=520), 1)
def ewin_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect_exact([b'>>>']), 0)
e.sendline(self._iter_n(n))
self.assertEqual(e.expect_exact([b'...']), 0)
@@ -77,7 +77,7 @@ class PerformanceTestCase (PexpectTestCa
self.assertEqual(e.expect_exact([b'inquisition', '%d' % n], searchwindowsize=20), 1)
def faster_range(self, n):
- e = pexpect.spawn('python', timeout=100)
+ e = pexpect.spawn(sys.executable, timeout=100)
self.assertEqual(e.expect(b'>>>'), 0)
e.sendline(('list(range(1, %d+1))' % n).encode('ascii'))
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
Index: pexpect-4.8.0/tests/test_replwrap.py
===================================================================
--- pexpect-4.8.0.orig/tests/test_replwrap.py
+++ pexpect-4.8.0/tests/test_replwrap.py
@@ -2,6 +2,7 @@ import platform
import unittest
import re
import os
+import sys
import pexpect
from pexpect import replwrap
@@ -108,7 +109,7 @@ class REPLWrapTestCase(unittest.TestCase
if platform.python_implementation() == 'PyPy':
raise unittest.SkipTest(skip_pypy)
- child = pexpect.spawn('python', echo=False, timeout=5, encoding='utf-8')
+ child = pexpect.spawn(sys.executable, echo=False, timeout=5, encoding='utf-8')
# prompt_change=None should mean no prompt change
py = replwrap.REPLWrapper(child, u">>> ", prompt_change=None,
continuation_prompt=u"... ")
Index: pexpect-4.8.0/tests/test_run.py
===================================================================
--- pexpect-4.8.0.orig/tests/test_run.py
+++ pexpect-4.8.0/tests/test_run.py
@@ -69,7 +69,7 @@ class RunFuncTestCase(PexpectTestCase.Pe
super(RunFuncTestCase, self).tearDown()
def test_run_exit(self):
- (data, exitstatus) = self.runfunc('python exit1.py', withexitstatus=1)
+ (data, exitstatus) = self.runfunc(sys.executable + ' exit1.py', withexitstatus=1)
assert exitstatus == 1, "Exit status of 'python exit1.py' should be 1."
def test_run(self):
Index: pexpect-4.8.0/pexpect/replwrap.py
===================================================================
--- pexpect-4.8.0.orig/pexpect/replwrap.py
+++ pexpect-4.8.0/pexpect/replwrap.py
@@ -108,7 +108,7 @@ class REPLWrapper(object):
+ command)
return u''.join(res + [self.child.before])
-def python(command="python"):
+def python(command=sys.executable):
"""Start a Python shell and return a :class:`REPLWrapper` object."""
return REPLWrapper(command, u">>> ", u"import sys; sys.ps1={0!r}; sys.ps2={1!r}")

BIN
pexpect-4.8.0.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
pexpect-4.9.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,39 @@
-------------------------------------------------------------------
Sat Nov 25 09:37:07 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 4.9:
* Add support for Python 3.12 #769.
* Clean up temporary files after UnicodeTests #753.
* Add Python 3.5, 3.6 and 3.12.0-rc.1 to test matrix #763.
* Set prompt correctly for zsh #712.
* Add zsh convenience function to replwrap module #751.
* Rework async unittests to rely on
unittest.IsolatedAsyncioTestCase #764.
* Make test_expect.py work on POSIX systems that are not Linux
based #698.
* Add support for ``socket``, which allows sockets to be used
crossplatform #745.
* Update async to work on newer versions of python #732.
* Remove deprecated RSAAuthentication option (SSHv1) #744.
* Multiple CI fixes #743 #737 #742 #739 #722.
* Use Github Actions for CI #734.
* Remove pytest-capturelog from testing requirements #730.
* Fix usage for Solaris #663 #604 #560.
* Fix threading for new versions of python #684.
* Fix documentation builds for use with Sphinx 3 #638.
* Use ``sys.executable`` for tests and wrapper, allowing the
calling python executable to be used instead #623.
* Update documentation about Wexpect #623.
* Added project urls to ``setup.py`` #620.
* Provide examples for how to use Pexpect and Pyte #587.
* Coerce compiled regex patterns type according to spawn
encoding #560.
* Several doc updates #626 #635 #643 #644 #728.
drop 31fab7b0edbe9b3401507b5dfa4db6aaf3fabca5.patch,
684.patch, 715.patch, 742.patch,
dae602d37493bae239e0e8db5b3dabafebfd59db.patch,
fix-fail-no-alias.patch, no-python-binary.patch: upstream
-------------------------------------------------------------------
Tue Oct 17 08:08:38 UTC 2023 - Daniel Garcia Moreno <daniel.garcia@suse.com>
@ -59,12 +95,12 @@ Thu Feb 23 08:37:45 UTC 2023 - Matej Cepl <mcepl@suse.com>
-------------------------------------------------------------------
Fri Jan 6 20:51:12 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add 684.patch, 715.patch: Python 3.11 support
- add 684.patch, 715.patch: Python 3.11 support
-------------------------------------------------------------------
Wed Nov 9 10:07:50 UTC 2022 - Dirk Müller <dmueller@suse.com>
- skip extra tests for qemu based builds
- skip extra tests for qemu based builds
-------------------------------------------------------------------
Thu Aug 5 12:42:51 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>
@ -326,7 +362,7 @@ Mon Apr 27 14:24:59 UTC 2015 - tbechtold@suse.com
-------------------------------------------------------------------
Fri Apr 11 08:37:18 UTC 2014 - dmueller@suse.com
- fix license (ISC)
- fix license (ISC)
-------------------------------------------------------------------
Thu Apr 3 12:28:20 UTC 2014 - dmueller@suse.com

View File

@ -18,22 +18,12 @@
%{?sle15_python_module_pythons}
Name: python-pexpect
Version: 4.8.0
Version: 4.9.0
Release: 0
Summary: Pure Python Expect-like module
License: ISC
URL: https://github.com/pexpect/pexpect
Source: https://files.pythonhosted.org/packages/source/p/pexpect/pexpect-%{version}.tar.gz
Patch0: no-python-binary.patch
# Newer asyncio / python 3.11 support
Patch1: https://github.com/pexpect/pexpect/pull/715.patch
Patch2: https://github.com/pexpect/pexpect/pull/684.patch
Patch3: fix-fail-no-alias.patch
# Python 3.12 tests
Patch4: https://github.com/pexpect/pexpect/commit/dae602d37493bae239e0e8db5b3dabafebfd59db.patch
Patch5: https://github.com/pexpect/pexpect/commit/31fab7b0edbe9b3401507b5dfa4db6aaf3fabca5.patch
# PATCH-FIX-UPSTREAM 742.patch gh#pexpect/pexpect#742
Patch6: 742.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module ptyprocess}
BuildRequires: %{python_module pytest}
@ -62,7 +52,6 @@ find examples -type f -name "*.py" -exec sed -i "s|#!%{_bindir}/env python||" {}
find examples -type f -name "*.cgi" -exec sed -i "s|##!%{_bindir}/env python|##!%{_bindir}/python|" {} \;
# Mark example *.py as non-executable (we already patch the shebang out, so they can't be started anyway)
find examples -type f -name "*.py" -exec chmod 644 {} \;
# Remove shebang
sed -i '1 {/^#!/d}' pexpect/FSM.py
@ -79,14 +68,7 @@ echo "set enable-bracketed-paste off" > .inputrc
export INPUTRC=$(readlink -f .inputrc) TRAVIS=true
# test_pager_as_cat - needs manpages that would pull extra deps
# test_interrupt, test_multiple_interrupts - hangs under linux-user emulation
# test_bash https://github.com/pexpect/pexpect/issues/568
# test_large_stdout_stream - random
# test_spawn_uses_env - seen failed on s390x
# test_forced_terminate - seen failed on armv7l
# test_interact_escape_None - seen failed on s390x
# test_existing_spawn - fails under linux-user emulation
# test_existing_spawn fails on s390x - gh#pexpect/pexpect#750
%pytest -k "not (test_pager_as_cat %{?qemu_user_space_build: or test_interrupt or test_multiple_interrupts})"
%pytest -k "not (test_pager_as_cat or test_zsh %{?qemu_user_space_build: or test_interrupt or test_multiple_interrupts})"
%files %{python_files}
%license LICENSE