Hello community, here is the log from the commit of package python-pexpect for openSUSE:Factory checked in at 2018-06-29 22:34:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pexpect (Old) and /work/SRC/openSUSE:Factory/.python-pexpect.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pexpect" Fri Jun 29 22:34:04 2018 rev:25 rq:618933 version:4.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pexpect/python-pexpect.changes 2018-04-20 17:33:00.346845842 +0200 +++ /work/SRC/openSUSE:Factory/.python-pexpect.new/python-pexpect.changes 2018-06-29 22:34:06.290121342 +0200 @@ -1,0 +2,12 @@ +Sun Jun 24 15:49:37 UTC 2018 - a...@gmx.de + +- update to version 4.6.0: + * The pxssh.login() method now supports an ssh_config parameter, + which can be used to specify a file path to an SSH config file (PR + #490). + * Improved compatability for the crlf parameter of PopenSpawn (PR + #493) + * Fixed an issue in read timeout handling when using spawn and + fdspawn with the use_poll parameter (PR #492). + +------------------------------------------------------------------- Old: ---- pexpect-4.5.0.tar.gz New: ---- pexpect-4.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pexpect.spec ++++++ --- /var/tmp/diff_new_pack.M2ruqB/_old 2018-06-29 22:34:06.674121008 +0200 +++ /var/tmp/diff_new_pack.M2ruqB/_new 2018-06-29 22:34:06.678121005 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pexpect -Version: 4.5.0 +Version: 4.6.0 Release: 0 Summary: Pure Python Expect-like module License: ISC ++++++ pexpect-4.5.0.tar.gz -> pexpect-4.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/PKG-INFO new/pexpect-4.6.0/PKG-INFO --- old/pexpect-4.5.0/PKG-INFO 2018-04-13 20:20:48.000000000 +0200 +++ new/pexpect-4.6.0/PKG-INFO 2018-05-29 14:32:50.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pexpect -Version: 4.5.0 +Version: 4.6.0 Summary: Pexpect allows easy control of interactive console applications. Home-page: https://pexpect.readthedocs.io/ Author: Noah Spurrier; Thomas Kluyver; Jeff Quast diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/doc/conf.py new/pexpect-4.6.0/doc/conf.py --- old/pexpect-4.5.0/doc/conf.py 2018-04-11 21:03:57.000000000 +0200 +++ new/pexpect-4.6.0/doc/conf.py 2018-05-29 14:15:18.000000000 +0200 @@ -52,7 +52,7 @@ # built documents. # # The short X.Y version. -version = '4.5' +version = '4.6' # The full version, including alpha/beta/rc tags. release = version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/doc/history.rst new/pexpect-4.6.0/doc/history.rst --- old/pexpect-4.5.0/doc/history.rst 2018-04-13 19:49:35.000000000 +0200 +++ new/pexpect-4.6.0/doc/history.rst 2018-05-29 14:12:45.000000000 +0200 @@ -4,6 +4,17 @@ Releases -------- +Version 4.6 +``````````` + +* The :meth:`.pxssh.login` method now supports an ``ssh_config`` parameter, + which can be used to specify a file path to an SSH config file + (:ghpull:`490`). +* Improved compatability for the ``crlf`` parameter of :class:`~.PopenSpawn` + (:ghpull:`493`) +* Fixed an issue in read timeout handling when using :class:`~.spawn` and + :class:`~.fdspawn` with the ``use_poll`` parameter (:ghpull:`492`). + Version 4.5 ``````````` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/pexpect/__init__.py new/pexpect-4.6.0/pexpect/__init__.py --- old/pexpect-4.5.0/pexpect/__init__.py 2018-04-11 21:03:57.000000000 +0200 +++ new/pexpect-4.6.0/pexpect/__init__.py 2018-05-29 14:15:18.000000000 +0200 @@ -75,7 +75,7 @@ from .pty_spawn import spawn, spawnu from .run import run, runu -__version__ = '4.5.0' +__version__ = '4.6.0' __revision__ = '' __all__ = ['ExceptionPexpect', 'EOF', 'TIMEOUT', 'spawn', 'spawnu', 'run', 'runu', 'which', 'split_command_line', '__version__', '__revision__'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/pexpect/popen_spawn.py new/pexpect-4.6.0/pexpect/popen_spawn.py --- old/pexpect-4.5.0/pexpect/popen_spawn.py 2018-02-10 13:16:58.000000000 +0100 +++ new/pexpect-4.6.0/pexpect/popen_spawn.py 2018-05-29 14:12:45.000000000 +0200 @@ -18,11 +18,6 @@ from .utils import string_types class PopenSpawn(SpawnBase): - if PY3: - crlf = '\n'.encode('ascii') - else: - crlf = '\n' - def __init__(self, cmd, timeout=30, maxread=2000, searchwindowsize=None, logfile=None, cwd=None, env=None, encoding=None, codec_errors='strict', preexec_fn=None): @@ -30,6 +25,18 @@ searchwindowsize=searchwindowsize, logfile=logfile, encoding=encoding, codec_errors=codec_errors) + # Note that `SpawnBase` initializes `self.crlf` to `\r\n` + # because the default behaviour for a PTY is to convert + # incoming LF to `\r\n` (see the `onlcr` flag and + # https://stackoverflow.com/a/35887657/5397009). Here we set + # it to `os.linesep` because that is what the spawned + # application outputs by default and `popen` doesn't translate + # anything. + if encoding is None: + self.crlf = os.linesep.encode ("ascii") + else: + self.crlf = self.string_type (os.linesep) + kwargs = dict(bufsize=0, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, cwd=cwd, preexec_fn=preexec_fn, env=env) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/pexpect/pxssh.py new/pexpect-4.6.0/pexpect/pxssh.py --- old/pexpect-4.5.0/pexpect/pxssh.py 2018-04-11 21:03:57.000000000 +0200 +++ new/pexpect-4.6.0/pexpect/pxssh.py 2018-05-29 14:12:45.000000000 +0200 @@ -259,7 +259,7 @@ sync_multiplier=1, check_local_ip=True, password_regex=r'(?i)(?:password:)|(?:passphrase for key)', ssh_tunnels={}, spawn_local_ssh=True, - sync_original_prompt=True): + sync_original_prompt=True, ssh_config=None): '''This logs the user into the given server. It uses @@ -294,8 +294,15 @@ session to do so. Setting this option to `False` and not having an active session will trigger an error. - Set ``ssh_key`` to `True` to force passing the current SSH authentication socket to the + Set ``ssh_key`` to a file path to an SSH private key to use that SSH key + for the session authentication. + Set ``ssh_key`` to `True` to force passing the current SSH authentication socket to the desired ``hostname``. + + Set ``ssh_config`` to a file path string of an SSH client config file to pass that + file to the client to handle itself. You may set any options you wish in here, however + doing so will require you to post extra information that you may not want to if you + run into issues. ''' session_regex_array = ["(?i)are you sure you want to continue connecting", original_prompt, password_regex, "(?i)permission denied", "(?i)terminal type", TIMEOUT] @@ -310,6 +317,10 @@ ssh_options = ssh_options + " -o'NoHostAuthenticationForLocalhost=yes'" if self.force_password: ssh_options = ssh_options + ' ' + self.SSH_OPTS + if ssh_config is not None: + if spawn_local_ssh and not os.path.isfile(ssh_config): + raise ExceptionPxssh('SSH config does not exist or is not a file.') + ssh_options = ssh_options + '-F ' + ssh_config if port is not None: ssh_options = ssh_options + ' -p %s'%(str(port)) if ssh_key is not None: @@ -317,11 +328,8 @@ if ssh_key==True: ssh_options = ssh_options + ' -A' else: - try: - if spawn_local_ssh: - os.path.isfile(ssh_key) - except: - raise ExceptionPxssh('private ssh key does not exist') + if spawn_local_ssh and not os.path.isfile(ssh_key): + raise ExceptionPxssh('private ssh key does not exist or is not a file.') ssh_options = ssh_options + ' -i %s' % (ssh_key) # SSH tunnels, make sure you know what you're putting into the lists diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/pexpect/utils.py new/pexpect-4.6.0/pexpect/utils.py --- old/pexpect-4.5.0/pexpect/utils.py 2018-04-13 19:35:52.000000000 +0200 +++ new/pexpect-4.6.0/pexpect/utils.py 2018-05-29 14:12:45.000000000 +0200 @@ -165,7 +165,7 @@ poller = select.poll() for fd in fds: - poller.register(fd) + poller.register(fd, select.POLLIN | select.POLLPRI | select.POLLHUP | select.POLLERR) while True: try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/tests/test_misc.py new/pexpect-4.6.0/tests/test_misc.py --- old/pexpect-4.5.0/tests/test_misc.py 2018-04-11 21:03:57.000000000 +0200 +++ new/pexpect-4.6.0/tests/test_misc.py 2018-05-29 14:12:45.000000000 +0200 @@ -87,6 +87,12 @@ remaining = child.read().replace(_CAT_EOF, b'') self.assertEqual(remaining, b'abc\r\n') + def test_read_poll_timeout(self): + " Test use_poll properly times out " + child = pexpect.spawn('sleep 5', use_poll=True) + with self.assertRaises(pexpect.TIMEOUT): + child.expect(pexpect.EOF, timeout=1) + def test_readline_bin_echo(self): " Test spawn('echo'). " # given, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/tests/test_popen_spawn.py new/pexpect-4.6.0/tests/test_popen_spawn.py --- old/pexpect-4.5.0/tests/test_popen_spawn.py 2015-12-08 19:43:59.000000000 +0100 +++ new/pexpect-4.6.0/tests/test_popen_spawn.py 2018-05-29 14:12:45.000000000 +0200 @@ -125,6 +125,14 @@ p.expect_exact('def') p.expect(pexpect.EOF) + def test_crlf(self): + p = PopenSpawn('echo alpha beta') + assert p.read() == b'alpha beta' + p.crlf + + def test_crlf_encoding(self): + p = PopenSpawn('echo alpha beta', encoding='utf-8') + assert p.read() == 'alpha beta' + p.crlf + if __name__ == '__main__': unittest.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pexpect-4.5.0/tests/test_pxssh.py new/pexpect-4.6.0/tests/test_pxssh.py --- old/pexpect-4.5.0/tests/test_pxssh.py 2018-04-11 21:03:57.000000000 +0200 +++ new/pexpect-4.6.0/tests/test_pxssh.py 2018-05-29 14:12:45.000000000 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/env python import os - +import tempfile import unittest from pexpect import pxssh @@ -85,6 +85,13 @@ if confirmation_strings!=len(confirmation_array): assert False, 'String generated from remote tunneling is incorrect.' + def test_ssh_config_passing_string(self): + ssh = pxssh.pxssh(debug_command_string=True) + (temp_file,config_path) = tempfile.mkstemp() + string = ssh.login('server', 'me', password='s3cret', spawn_local_ssh=False, ssh_config=config_path) + if not '-F '+config_path in string: + assert False, 'String generated from SSH config passing is incorrect.' + def test_ssh_key_string(self): ssh = pxssh.pxssh(debug_command_string=True) confirmation_strings = 0 @@ -98,8 +105,9 @@ assert False, 'String generated from forcing the SSH agent sock is incorrect.' confirmation_strings = 0 - confirmation_array = [' -i True'] - string = ssh.login('server', 'me', password='s3cret', ssh_key='True') + (temp_file,ssh_key) = tempfile.mkstemp() + confirmation_array = [' -i '+ssh_key] + string = ssh.login('server', 'me', password='s3cret', ssh_key=ssh_key) for confirmation in confirmation_array: if confirmation in string: confirmation_strings+=1