From ac399df3d64659fb928c8889b1141351d6467c51 Mon Sep 17 00:00:00 2001 From: Fabian Deutsch Date: Tue, 8 Apr 2014 18:34:11 +0200 Subject: [PATCH 01/34] Update to 3.1 Signed-off-by: Fabian Deutsch --- .gitignore | 1 + python-pexpect.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bc6307e..a7257c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ pexpect-2.3.tar.gz /pexpect-u-2.5.1.tar.gz /pexpect-3.0.tar.gz +/pexpect-3.1.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index 3cc41c9..6418d6d 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -8,7 +8,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-pexpect -Version: 3.0 +Version: 3.1 Release: 1%{?dist} License: MIT Group: Development/Languages @@ -137,6 +137,9 @@ rm -rf %{buildroot} %endif # with_python3 %changelog +* Tue Apr 08 2014 Fabian Deutsch - 3.1-1 +- Update to 3.1 + * Tue Nov 12 2013 Thomas Spura - 3.0-1 - update to 3.0 diff --git a/sources b/sources index a45f815..40c2c34 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6abaca6ee606945ce42baf042b00e87e pexpect-3.0.tar.gz +4176062f4dd184cf31639478a46f789b pexpect-3.1.tar.gz From 43708aea4090901a41e0945f1ecfafb7df6f8979 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Fri, 16 May 2014 08:47:12 +0200 Subject: [PATCH 02/34] Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 6418d6d..39cf3e6 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -9,7 +9,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-pexpect Version: 3.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT Group: Development/Languages URL: https://github.com/pexpect/pexpect @@ -137,6 +137,9 @@ rm -rf %{buildroot} %endif # with_python3 %changelog +* Wed May 14 2014 Bohuslav Kabrda - 3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + * Tue Apr 08 2014 Fabian Deutsch - 3.1-1 - Update to 3.1 From aeb702440793f619e9ab575f65dca84ce73177ec Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 17:02:54 -0500 Subject: [PATCH 03/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 39cf3e6..7983216 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -9,7 +9,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-pexpect Version: 3.1 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT Group: Development/Languages URL: https://github.com/pexpect/pexpect @@ -137,6 +137,9 @@ rm -rf %{buildroot} %endif # with_python3 %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 3.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Wed May 14 2014 Bohuslav Kabrda - 3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 From 33da561670c80e42254abea354d17c1dc73f6a0c Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 18 Jun 2015 20:15:48 +0000 Subject: [PATCH 04/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 7983216..28f4643 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -9,7 +9,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-pexpect Version: 3.1 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT Group: Development/Languages URL: https://github.com/pexpect/pexpect @@ -137,6 +137,9 @@ rm -rf %{buildroot} %endif # with_python3 %changelog +* Thu Jun 18 2015 Fedora Release Engineering - 3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Sat Jun 07 2014 Fedora Release Engineering - 3.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 3794f67a397d8df921c5dae4e79229aa22ad4e06 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 6 Oct 2015 09:40:50 +0200 Subject: [PATCH 05/34] Update to 4.0; Follow modern RPM Packaging guidelines Signed-off-by: Igor Gnatenko --- .gitignore | 1 + coveragerc | 3 + python-pexpect.spec | 134 ++++++++++++++++++++------------------------ sources | 2 +- 4 files changed, 66 insertions(+), 74 deletions(-) create mode 100644 coveragerc diff --git a/.gitignore b/.gitignore index a7257c9..00ae84c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ pexpect-2.3.tar.gz /pexpect-u-2.5.1.tar.gz /pexpect-3.0.tar.gz /pexpect-3.1.tar.gz +/pexpect-4.0.tar.gz diff --git a/coveragerc b/coveragerc new file mode 100644 index 0000000..7e2d9e2 --- /dev/null +++ b/coveragerc @@ -0,0 +1,3 @@ +[run] +source = pexpect +parallel = True diff --git a/python-pexpect.spec b/python-pexpect.spec index 28f4643..e5e5558 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -1,28 +1,17 @@ -%if 0%{?fedora} > 15 -%global with_python3 1 -%else -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif - -#global relcand rc3 +%global modname pexpect Summary: Unicode-aware Pure Python Expect-like module -Name: python-pexpect -Version: 3.1 -Release: 4%{?dist} +Name: python-%{modname} +Version: 4.0 +Release: 1%{?dist} License: MIT -Group: Development/Languages -URL: https://github.com/pexpect/pexpect -Source0: https://github.com/pexpect/pexpect/releases/download/%{version}%{?relcand}/pexpect-%{version}%{?relcand}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +URL: https://github.com/%{modname}/%{modname} +Source0: https://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz +Source1: coveragerc BuildArch: noarch -BuildRequires: python2-devel python-nose ed -%if 0%{?with_python3} -BuildRequires: python3-devel python3-nose Provides: pexpect = %{version}-%{release} Obsoletes: pexpect <= 2.3-20 -%endif # if with_python3 %description Pexpect is a pure Python module for spawning child applications; controlling @@ -39,10 +28,33 @@ does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module. -%if 0%{?with_python3} +%package -n python2-pexpect +Summary: Unicode-aware Pure Python Expect-like module for Python 2 +BuildRequires: python2-devel +BuildRequires: python2-pytest python-ptyprocess +Requires: python-ptyprocess + +%description -n python2-pexpect +Pexpect is a pure Python module for spawning child applications; controlling +them; and responding to expected patterns in their output. Pexpect works like +Don Libes' Expect. Pexpect allows your script to spawn a child application and +control it as if a human were typing commands. This package contains the +python2 version of this module. + +Pexpect can be used for automating interactive applications such as ssh, ftp, +passwd, telnet, etc. It can be used to automate setup scripts for duplicating +software package installations on different servers. And it can be used for +automated software testing. Pexpect is in the spirit of Don Libes' Expect, but +Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect +does not require TCL or Expect nor does it require C extensions to be +compiled. It should work on any platform that supports the standard Python +pty module. + %package -n python3-pexpect Summary: Unicode-aware Pure Python Expect-like module for Python 3 -Group: Development/Languages +BuildRequires: python3-devel +BuildRequires: python3-pytest python3-ptyprocess +Requires: python3-ptyprocess %description -n python3-pexpect Pexpect is a pure Python module for spawning child applications; controlling @@ -59,84 +71,60 @@ Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module. -%endif # with_python3 %prep -%setup -q -n pexpect-%{version}%{?relcand} - +%autosetup -n %{modname}-%{version} +sed -i -e 1i"# -*- encoding: utf-8 -*-" setup.py +cp -p %{SOURCE1} .coveragerc #sed -i "s/0.1/10.0/g" tests/test_misc.py -%if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif # with_python3 %build -%{__python} setup.py build +%py2_build -%if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py build + %py3_build popd -%endif # with_python3 - -%check -. ./test.env -./tools/testall.py - -%if 0%{?with_python3} -pushd %{py3dir} - . ./test.env - %{_bindir}/python3 ./tools/testall.py -popd -%endif # with_python3 %install -rm -rf %{buildroot} +%py2_install +rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests +# Correct some permissions +find examples -type f -exec chmod a-x \{\} \; +rm -f %{buildroot}%{python2_sitelib}/%{modname}/async.py -%if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install --skip-build \ - --root %{buildroot} --install-lib %{python3_sitelib} - -# Correct some permissions -find examples -type f -exec chmod a-x \{\} \; - -rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests + %py3_install + # Correct some permissions + find examples -type f -exec chmod a-x \{\} \; + rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests popd -%endif # with_python3 -%{__python} setup.py install --skip-build \ - --root %{buildroot} --install-lib %{python_sitelib} +%check +py.test-2 --verbose -rm -rf ${buildroot}%{python_sitelib}/setuptools/tests - -# Correct some permissions -find examples -type f -exec chmod a-x \{\} \; - -%clean -rm -rf %{buildroot} +pushd %{py3dir} + py.test-3 --verbose +popd %files -%defattr(-,root,root) -%doc doc examples LICENSE -%{python_sitelib}/*.py* -%{python_sitelib}/pexpect/ -%{python_sitelib}/pexpect-%{version}%{?relcand}-py?.?.egg-info -%exclude %{python_sitelib}/pexpect/tests/ +%license LICENSE +%doc doc examples +%{python2_sitelib}/%{modname}* -%if 0%{?with_python3} %files -n python3-pexpect -%doc doc examples LICENSE -%{python3_sitelib}/*.py -%{python3_sitelib}/__pycache__/* -%{python3_sitelib}/pexpect/ -%{python3_sitelib}/pexpect-%{version}%{?relcand}-py?.?.egg-info -%exclude %{python3_sitelib}/pexpect/tests/ -%endif # with_python3 +%license LICENSE +%doc doc examples +%{python3_sitelib}/%{modname}* %changelog +* Mon Oct 05 2015 Igor Gnatenko - 4.0-1 +- Update to 4.0 +- Follow modern RPM Packaging guidelines + * Thu Jun 18 2015 Fedora Release Engineering - 3.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index 40c2c34..f5d8f65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4176062f4dd184cf31639478a46f789b pexpect-3.1.tar.gz +00dcea09c486f03aa7857cbe2b916085 pexpect-4.0.tar.gz From 3c7f8c5955bfd8407674283ab3332c1f95063db4 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 6 Oct 2015 10:16:35 +0200 Subject: [PATCH 06/34] add upstream tools to display some info Signed-off-by: Igor Gnatenko --- display-sighandlers.py | 24 +++++ display-terminalinfo.py | 209 ++++++++++++++++++++++++++++++++++++++++ python-pexpect.spec | 8 ++ 3 files changed, 241 insertions(+) create mode 100755 display-sighandlers.py create mode 100755 display-terminalinfo.py diff --git a/display-sighandlers.py b/display-sighandlers.py new file mode 100755 index 0000000..f3559f7 --- /dev/null +++ b/display-sighandlers.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# Displays all signals, their values, and their handlers. +from __future__ import print_function +import signal +FMT = '{name:<10} {value:<5} {description}' + +# header +print(FMT.format(name='name', value='value', description='description')) +print('-' * (33)) + +for name, value in [(signal_name, getattr(signal, signal_name)) + for signal_name in dir(signal) + if signal_name.startswith('SIG') + and not signal_name.startswith('SIG_')]: + try: + handler = signal.getsignal(value) + except ValueError: + # FreeBSD: signal number out of range + handler = 'out of range' + description = { + signal.SIG_IGN: "ignored(SIG_IGN)", + signal.SIG_DFL: "default(SIG_DFL)" + }.get(handler, handler) + print(FMT.format(name=name, value=value, description=description)) diff --git a/display-terminalinfo.py b/display-terminalinfo.py new file mode 100755 index 0000000..15911d4 --- /dev/null +++ b/display-terminalinfo.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python +""" Display known information about our terminal. """ +from __future__ import print_function +import termios +import locale +import sys +import os + +BITMAP_IFLAG = { + 'IGNBRK': 'ignore BREAK condition', + 'BRKINT': 'map BREAK to SIGINTR', + 'IGNPAR': 'ignore (discard) parity errors', + 'PARMRK': 'mark parity and framing errors', + 'INPCK': 'enable checking of parity errors', + 'ISTRIP': 'strip 8th bit off chars', + 'INLCR': 'map NL into CR', + 'IGNCR': 'ignore CR', + 'ICRNL': 'map CR to NL (ala CRMOD)', + 'IXON': 'enable output flow control', + 'IXOFF': 'enable input flow control', + 'IXANY': 'any char will restart after stop', + 'IMAXBEL': 'ring bell on input queue full', + 'IUCLC': 'translate upper case to lower case', +} + +BITMAP_OFLAG = { + 'OPOST': 'enable following output processing', + 'ONLCR': 'map NL to CR-NL (ala CRMOD)', + 'OXTABS': 'expand tabs to spaces', + 'ONOEOT': 'discard EOT\'s `^D\' on output)', + 'OCRNL': 'map CR to NL', + 'OLCUC': 'translate lower case to upper case', + 'ONOCR': 'No CR output at column 0', + 'ONLRET': 'NL performs CR function', +} + +BITMAP_CFLAG = { + 'CSIZE': 'character size mask', + 'CS5': '5 bits (pseudo)', + 'CS6': '6 bits', + 'CS7': '7 bits', + 'CS8': '8 bits', + 'CSTOPB': 'send 2 stop bits', + 'CREAD': 'enable receiver', + 'PARENB': 'parity enable', + 'PARODD': 'odd parity, else even', + 'HUPCL': 'hang up on last close', + 'CLOCAL': 'ignore modem status lines', + 'CCTS_OFLOW': 'CTS flow control of output', + 'CRTSCTS': 'same as CCTS_OFLOW', + 'CRTS_IFLOW': 'RTS flow control of input', + 'MDMBUF': 'flow control output via Carrier', +} + +BITMAP_LFLAG = { + 'ECHOKE': 'visual erase for line kill', + 'ECHOE': 'visually erase chars', + 'ECHO': 'enable echoing', + 'ECHONL': 'echo NL even if ECHO is off', + 'ECHOPRT': 'visual erase mode for hardcopy', + 'ECHOCTL': 'echo control chars as ^(Char)', + 'ISIG': 'enable signals INTR, QUIT, [D]SUSP', + 'ICANON': 'canonicalize input lines', + 'ALTWERASE': 'use alternate WERASE algorithm', + 'IEXTEN': 'enable DISCARD and LNEXT', + 'EXTPROC': 'external processing', + 'TOSTOP': 'stop background jobs from output', + 'FLUSHO': 'output being flushed (state)', + 'NOKERNINFO': 'no kernel output from VSTATUS', + 'PENDIN': 'XXX retype pending input (state)', + 'NOFLSH': 'don\'t flush after interrupt', +} + +CTLCHAR_INDEX = { + 'VEOF': 'EOF', + 'VEOL': 'EOL', + 'VEOL2': 'EOL2', + 'VERASE': 'ERASE', + 'VWERASE': 'WERASE', + 'VKILL': 'KILL', + 'VREPRINT': 'REPRINT', + 'VINTR': 'INTR', + 'VQUIT': 'QUIT', + 'VSUSP': 'SUSP', + 'VDSUSP': 'DSUSP', + 'VSTART': 'START', + 'VSTOP': 'STOP', + 'VLNEXT': 'LNEXT', + 'VDISCARD': 'DISCARD', + 'VMIN': '---', + 'VTIME': '---', + 'VSTATUS': 'STATUS', +} + + +def display_bitmask(kind, bitmap, value): + """ Display all matching bitmask values for ``value`` given ``bitmap``. """ + col1_width = max(map(len, list(bitmap.keys()) + [kind])) + col2_width = 7 + FMT = '{name:>{col1_width}} {value:>{col2_width}} {description}' + print(FMT.format(name=kind, + value='Value', + description='Description', + col1_width=col1_width, + col2_width=col2_width)) + print('{0} {1} {2}'.format('-' * col1_width, + '-' * col2_width, + '-' * max(map(len, bitmap.values())))) + for flag_name, description in bitmap.items(): + try: + bitmask = getattr(termios, flag_name) + bit_val = 'on' if bool(value & bitmask) else 'off' + except AttributeError: + bit_val = 'undef' + print(FMT.format(name=flag_name, + value=bit_val, + description=description, + col1_width=col1_width, + col2_width=col2_width)) + print() + + +def display_ctl_chars(index, cc): + """ Display all control character indicies, names, and values. """ + title = 'Special Character' + col1_width = len(title) + col2_width = max(map(len, index.values())) + FMT = '{idx:<{col1_width}} {name:<{col2_width}} {value}' + print('Special line Characters'.center(40).rstrip()) + print(FMT.format(idx='Index', + name='Name', + value='Value', + col1_width=col1_width, + col2_width=col2_width)) + print('{0} {1} {2}'.format('-' * col1_width, + '-' * col2_width, + '-' * 10)) + for index_name, name in index.items(): + try: + index = getattr(termios, index_name) + value = cc[index] + if value == b'\xff': + value = '_POSIX_VDISABLE' + else: + value = repr(value) + except AttributeError: + value = 'undef' + print(FMT.format(idx=index_name, + name=name, + value=value, + col1_width=col1_width, + col2_width=col2_width)) + print() + + +def display_conf(kind, names, getter): + col1_width = max(map(len, names)) + FMT = '{name:>{col1_width}} {value}' + print(FMT.format(name=kind, + value='value', + col1_width=col1_width)) + print('{0} {1}'.format('-' * col1_width, '-' * 27)) + for name in names: + try: + value = getter(name) + except OSError as err: + value = err + print(FMT.format(name=name, value=value, col1_width=col1_width)) + print() + + +def main(): + fd = sys.stdin.fileno() + locale.setlocale(locale.LC_ALL, '') + encoding = locale.getpreferredencoding() + + print('os.isatty({0}) => {1}'.format(fd, os.isatty(fd))) + print('locale.getpreferredencoding() => {0}'.format(encoding)) + + display_conf(kind='pathconf', + names=os.pathconf_names, + getter=lambda name: os.fpathconf(fd, name)) + + try: + (iflag, oflag, cflag, lflag, ispeed, ospeed, cc + ) = termios.tcgetattr(fd) + except termios.error as err: + print('stdin is not a typewriter: {0}'.format(err)) + else: + display_bitmask(kind='Input Mode', + bitmap=BITMAP_IFLAG, + value=iflag) + display_bitmask(kind='Output Mode', + bitmap=BITMAP_OFLAG, + value=oflag) + display_bitmask(kind='Control Mode', + bitmap=BITMAP_CFLAG, + value=cflag) + display_bitmask(kind='Local Mode', + bitmap=BITMAP_LFLAG, + value=lflag) + display_ctl_chars(index=CTLCHAR_INDEX, + cc=cc) + print('os.ttyname({0}) => {1}'.format(fd, os.ttyname(fd))) + print('os.ctermid() => {0}'.format(os.ttyname(fd))) + + +if __name__ == '__main__': + main() diff --git a/python-pexpect.spec b/python-pexpect.spec index e5e5558..841c2bb 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -8,6 +8,8 @@ License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz Source1: coveragerc +Source2: https://raw.githubusercontent.com/pexpect/pexpect/master/tools/display-sighandlers.py +Source3: https://raw.githubusercontent.com/pexpect/pexpect/master/tools/display-terminalinfo.py BuildArch: noarch Provides: pexpect = %{version}-%{release} @@ -76,6 +78,9 @@ pty module. %autosetup -n %{modname}-%{version} sed -i -e 1i"# -*- encoding: utf-8 -*-" setup.py cp -p %{SOURCE1} .coveragerc +rm -rf tools/ +mkdir tools/ +cp -p %{SOURCE2} %{SOURCE3} tools/ #sed -i "s/0.1/10.0/g" tests/test_misc.py rm -rf %{py3dir} @@ -104,6 +109,9 @@ pushd %{py3dir} popd %check +./tools/display-sighandlers.py +./tools/display-terminalinfo.py + py.test-2 --verbose pushd %{py3dir} From 6f0453560271cf860aebb6483a04d46079f7af3f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 6 Oct 2015 13:13:38 +0200 Subject: [PATCH 07/34] fix testsuite Signed-off-by: Igor Gnatenko --- ...and-line-args-for-unicode-mode-spawn.patch | 29 +++++++++++++++++++ pexpect-4.0-disable-some-tests.patch | 25 ++++++++++++++++ python-pexpect.spec | 9 +++++- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 0001-Encode-command-line-args-for-unicode-mode-spawn.patch create mode 100644 pexpect-4.0-disable-some-tests.patch diff --git a/0001-Encode-command-line-args-for-unicode-mode-spawn.patch b/0001-Encode-command-line-args-for-unicode-mode-spawn.patch new file mode 100644 index 0000000..abb3bda --- /dev/null +++ b/0001-Encode-command-line-args-for-unicode-mode-spawn.patch @@ -0,0 +1,29 @@ +From fa5ece24786d659e0bcd8423d66cbaa51b3d8d6c Mon Sep 17 00:00:00 2001 +From: Thomas Kluyver +Date: Tue, 6 Oct 2015 11:30:10 +0100 +Subject: [PATCH] Encode command line args for unicode-mode spawn + +Attempt to address gh-272 +--- + pexpect/pty_spawn.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py +index 1d9554b..7fc27fe 100644 +--- a/pexpect/pty_spawn.py ++++ b/pexpect/pty_spawn.py +@@ -285,6 +285,11 @@ class spawn(SpawnBase): + if dimensions is not None: + kwargs['dimensions'] = dimensions + ++ if self.encoding is not None: ++ # Encode command line using the specified encoding ++ self.args = [a if isinstance(a, bytes) else a.encode(self.encoding) ++ for a in self.args] ++ + self.ptyproc = ptyprocess.PtyProcess.spawn(self.args, env=self.env, + cwd=self.cwd, **kwargs) + +-- +2.6.0 + diff --git a/pexpect-4.0-disable-some-tests.patch b/pexpect-4.0-disable-some-tests.patch new file mode 100644 index 0000000..e986a3a --- /dev/null +++ b/pexpect-4.0-disable-some-tests.patch @@ -0,0 +1,25 @@ +diff --git a/tests/test_async.py b/tests/test_async.py +index ce75572..7bee98f 100644 +--- a/tests/test_async.py ++++ b/tests/test_async.py +@@ -48,4 +48,4 @@ class AsyncTests(PexpectTestCase): + p = pexpect.spawn('%s list100.py' % sys.executable) + assert run(p.expect_exact(b'5', async=True)) == 0 + assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 +- assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 ++ #assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 +diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py +index 772a3b7..02b5dc7 100644 +--- a/tests/test_maxcanon.py ++++ b/tests/test_maxcanon.py +@@ -126,8 +126,8 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): + # which has written it back out, + child.expect_exact('_' * (send_bytes - 1)) + # and not a byte more. +- with self.assertRaises(pexpect.TIMEOUT): +- child.expect_exact('_', timeout=1) ++ #with self.assertRaises(pexpect.TIMEOUT): ++ # child.expect_exact('_', timeout=1) + + # cleanup, + child.sendeof() # exit cat(1) diff --git a/python-pexpect.spec b/python-pexpect.spec index 841c2bb..124f0ef 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -11,7 +11,12 @@ Source1: coveragerc Source2: https://raw.githubusercontent.com/pexpect/pexpect/master/tools/display-sighandlers.py Source3: https://raw.githubusercontent.com/pexpect/pexpect/master/tools/display-terminalinfo.py +# https://github.com/pexpect/pexpect/pull/274 +Patch0: 0001-Encode-command-line-args-for-unicode-mode-spawn.patch +Patch1: pexpect-4.0-disable-some-tests.patch + BuildArch: noarch +BuildRequires: git-core Provides: pexpect = %{version}-%{release} Obsoletes: pexpect <= 2.3-20 @@ -75,7 +80,7 @@ compiled. It should work on any platform that supports the standard Python pty module. %prep -%autosetup -n %{modname}-%{version} +%autosetup -n %{modname}-%{version} -S git sed -i -e 1i"# -*- encoding: utf-8 -*-" setup.py cp -p %{SOURCE1} .coveragerc rm -rf tools/ @@ -109,6 +114,8 @@ pushd %{py3dir} popd %check +export PYTHONIOENCODING=UTF-8 +export LC_ALL="en_US.UTF-8" ./tools/display-sighandlers.py ./tools/display-terminalinfo.py From e5810651d087c077d6bba8ce31eb346b172e574a Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 6 Oct 2015 19:55:09 +0200 Subject: [PATCH 08/34] Update to 4.0.1 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + pexpect-4.0-disable-some-tests.patch | 25 ----------------------- python-pexpect.spec | 30 ++++++++++++++-------------- sources | 2 +- 4 files changed, 17 insertions(+), 41 deletions(-) delete mode 100644 pexpect-4.0-disable-some-tests.patch diff --git a/.gitignore b/.gitignore index 00ae84c..666884d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ pexpect-2.3.tar.gz /pexpect-3.0.tar.gz /pexpect-3.1.tar.gz /pexpect-4.0.tar.gz +/pexpect-4.0.1.tar.gz diff --git a/pexpect-4.0-disable-some-tests.patch b/pexpect-4.0-disable-some-tests.patch deleted file mode 100644 index e986a3a..0000000 --- a/pexpect-4.0-disable-some-tests.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/tests/test_async.py b/tests/test_async.py -index ce75572..7bee98f 100644 ---- a/tests/test_async.py -+++ b/tests/test_async.py -@@ -48,4 +48,4 @@ class AsyncTests(PexpectTestCase): - p = pexpect.spawn('%s list100.py' % sys.executable) - assert run(p.expect_exact(b'5', async=True)) == 0 - assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 -- assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 -+ #assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 -diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py -index 772a3b7..02b5dc7 100644 ---- a/tests/test_maxcanon.py -+++ b/tests/test_maxcanon.py -@@ -126,8 +126,8 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): - # which has written it back out, - child.expect_exact('_' * (send_bytes - 1)) - # and not a byte more. -- with self.assertRaises(pexpect.TIMEOUT): -- child.expect_exact('_', timeout=1) -+ #with self.assertRaises(pexpect.TIMEOUT): -+ # child.expect_exact('_', timeout=1) - - # cleanup, - child.sendeof() # exit cat(1) diff --git a/python-pexpect.spec b/python-pexpect.spec index 124f0ef..052bd8c 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -2,18 +2,15 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} -Version: 4.0 +Version: 4.0.1 Release: 1%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} -Source0: https://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz -Source1: coveragerc -Source2: https://raw.githubusercontent.com/pexpect/pexpect/master/tools/display-sighandlers.py -Source3: https://raw.githubusercontent.com/pexpect/pexpect/master/tools/display-terminalinfo.py +Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz -# https://github.com/pexpect/pexpect/pull/274 -Patch0: 0001-Encode-command-line-args-for-unicode-mode-spawn.patch -Patch1: pexpect-4.0-disable-some-tests.patch +Patch0: pexpect-4.0.1-disable-some-tests.patch +Patch1: 0001-disable-max-canon-tests-retain-file-contents.patch +Patch2: 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch BuildArch: noarch BuildRequires: git-core @@ -81,11 +78,7 @@ pty module. %prep %autosetup -n %{modname}-%{version} -S git -sed -i -e 1i"# -*- encoding: utf-8 -*-" setup.py -cp -p %{SOURCE1} .coveragerc -rm -rf tools/ -mkdir tools/ -cp -p %{SOURCE2} %{SOURCE3} tools/ +chmod +x ./tools/* #sed -i "s/0.1/10.0/g" tests/test_misc.py rm -rf %{py3dir} @@ -116,12 +109,16 @@ popd %check export PYTHONIOENCODING=UTF-8 export LC_ALL="en_US.UTF-8" -./tools/display-sighandlers.py -./tools/display-terminalinfo.py +%{__python2} ./tools/display-sighandlers.py +%{__python2} ./tools/display-terminalinfo.py +PYTHONPATH=`pwd` %{__python2} ./tools/display-maxcanon.py py.test-2 --verbose pushd %{py3dir} + %{__python3} ./tools/display-sighandlers.py + %{__python3} ./tools/display-terminalinfo.py + PYTHONPATH=`pwd` %{__python3} ./tools/display-maxcanon.py py.test-3 --verbose popd @@ -136,6 +133,9 @@ popd %{python3_sitelib}/%{modname}* %changelog +* Tue Oct 06 2015 Igor Gnatenko - 4.0.1-1 +- Update to 4.0.1 + * Mon Oct 05 2015 Igor Gnatenko - 4.0-1 - Update to 4.0 - Follow modern RPM Packaging guidelines diff --git a/sources b/sources index f5d8f65..4f96121 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -00dcea09c486f03aa7857cbe2b916085 pexpect-4.0.tar.gz +2bd260f7f2159f9bcab373721736d526 pexpect-4.0.1.tar.gz From 0c3c8c2c61aebb4f1c3a0f29387168eb3bcf59ca Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 7 Oct 2015 08:57:21 +0200 Subject: [PATCH 09/34] drop unneeded patches Signed-off-by: Igor Gnatenko --- coveragerc | 3 - display-sighandlers.py | 24 ----- display-terminalinfo.py | 209 ---------------------------------------- 3 files changed, 236 deletions(-) delete mode 100644 coveragerc delete mode 100755 display-sighandlers.py delete mode 100755 display-terminalinfo.py diff --git a/coveragerc b/coveragerc deleted file mode 100644 index 7e2d9e2..0000000 --- a/coveragerc +++ /dev/null @@ -1,3 +0,0 @@ -[run] -source = pexpect -parallel = True diff --git a/display-sighandlers.py b/display-sighandlers.py deleted file mode 100755 index f3559f7..0000000 --- a/display-sighandlers.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# Displays all signals, their values, and their handlers. -from __future__ import print_function -import signal -FMT = '{name:<10} {value:<5} {description}' - -# header -print(FMT.format(name='name', value='value', description='description')) -print('-' * (33)) - -for name, value in [(signal_name, getattr(signal, signal_name)) - for signal_name in dir(signal) - if signal_name.startswith('SIG') - and not signal_name.startswith('SIG_')]: - try: - handler = signal.getsignal(value) - except ValueError: - # FreeBSD: signal number out of range - handler = 'out of range' - description = { - signal.SIG_IGN: "ignored(SIG_IGN)", - signal.SIG_DFL: "default(SIG_DFL)" - }.get(handler, handler) - print(FMT.format(name=name, value=value, description=description)) diff --git a/display-terminalinfo.py b/display-terminalinfo.py deleted file mode 100755 index 15911d4..0000000 --- a/display-terminalinfo.py +++ /dev/null @@ -1,209 +0,0 @@ -#!/usr/bin/env python -""" Display known information about our terminal. """ -from __future__ import print_function -import termios -import locale -import sys -import os - -BITMAP_IFLAG = { - 'IGNBRK': 'ignore BREAK condition', - 'BRKINT': 'map BREAK to SIGINTR', - 'IGNPAR': 'ignore (discard) parity errors', - 'PARMRK': 'mark parity and framing errors', - 'INPCK': 'enable checking of parity errors', - 'ISTRIP': 'strip 8th bit off chars', - 'INLCR': 'map NL into CR', - 'IGNCR': 'ignore CR', - 'ICRNL': 'map CR to NL (ala CRMOD)', - 'IXON': 'enable output flow control', - 'IXOFF': 'enable input flow control', - 'IXANY': 'any char will restart after stop', - 'IMAXBEL': 'ring bell on input queue full', - 'IUCLC': 'translate upper case to lower case', -} - -BITMAP_OFLAG = { - 'OPOST': 'enable following output processing', - 'ONLCR': 'map NL to CR-NL (ala CRMOD)', - 'OXTABS': 'expand tabs to spaces', - 'ONOEOT': 'discard EOT\'s `^D\' on output)', - 'OCRNL': 'map CR to NL', - 'OLCUC': 'translate lower case to upper case', - 'ONOCR': 'No CR output at column 0', - 'ONLRET': 'NL performs CR function', -} - -BITMAP_CFLAG = { - 'CSIZE': 'character size mask', - 'CS5': '5 bits (pseudo)', - 'CS6': '6 bits', - 'CS7': '7 bits', - 'CS8': '8 bits', - 'CSTOPB': 'send 2 stop bits', - 'CREAD': 'enable receiver', - 'PARENB': 'parity enable', - 'PARODD': 'odd parity, else even', - 'HUPCL': 'hang up on last close', - 'CLOCAL': 'ignore modem status lines', - 'CCTS_OFLOW': 'CTS flow control of output', - 'CRTSCTS': 'same as CCTS_OFLOW', - 'CRTS_IFLOW': 'RTS flow control of input', - 'MDMBUF': 'flow control output via Carrier', -} - -BITMAP_LFLAG = { - 'ECHOKE': 'visual erase for line kill', - 'ECHOE': 'visually erase chars', - 'ECHO': 'enable echoing', - 'ECHONL': 'echo NL even if ECHO is off', - 'ECHOPRT': 'visual erase mode for hardcopy', - 'ECHOCTL': 'echo control chars as ^(Char)', - 'ISIG': 'enable signals INTR, QUIT, [D]SUSP', - 'ICANON': 'canonicalize input lines', - 'ALTWERASE': 'use alternate WERASE algorithm', - 'IEXTEN': 'enable DISCARD and LNEXT', - 'EXTPROC': 'external processing', - 'TOSTOP': 'stop background jobs from output', - 'FLUSHO': 'output being flushed (state)', - 'NOKERNINFO': 'no kernel output from VSTATUS', - 'PENDIN': 'XXX retype pending input (state)', - 'NOFLSH': 'don\'t flush after interrupt', -} - -CTLCHAR_INDEX = { - 'VEOF': 'EOF', - 'VEOL': 'EOL', - 'VEOL2': 'EOL2', - 'VERASE': 'ERASE', - 'VWERASE': 'WERASE', - 'VKILL': 'KILL', - 'VREPRINT': 'REPRINT', - 'VINTR': 'INTR', - 'VQUIT': 'QUIT', - 'VSUSP': 'SUSP', - 'VDSUSP': 'DSUSP', - 'VSTART': 'START', - 'VSTOP': 'STOP', - 'VLNEXT': 'LNEXT', - 'VDISCARD': 'DISCARD', - 'VMIN': '---', - 'VTIME': '---', - 'VSTATUS': 'STATUS', -} - - -def display_bitmask(kind, bitmap, value): - """ Display all matching bitmask values for ``value`` given ``bitmap``. """ - col1_width = max(map(len, list(bitmap.keys()) + [kind])) - col2_width = 7 - FMT = '{name:>{col1_width}} {value:>{col2_width}} {description}' - print(FMT.format(name=kind, - value='Value', - description='Description', - col1_width=col1_width, - col2_width=col2_width)) - print('{0} {1} {2}'.format('-' * col1_width, - '-' * col2_width, - '-' * max(map(len, bitmap.values())))) - for flag_name, description in bitmap.items(): - try: - bitmask = getattr(termios, flag_name) - bit_val = 'on' if bool(value & bitmask) else 'off' - except AttributeError: - bit_val = 'undef' - print(FMT.format(name=flag_name, - value=bit_val, - description=description, - col1_width=col1_width, - col2_width=col2_width)) - print() - - -def display_ctl_chars(index, cc): - """ Display all control character indicies, names, and values. """ - title = 'Special Character' - col1_width = len(title) - col2_width = max(map(len, index.values())) - FMT = '{idx:<{col1_width}} {name:<{col2_width}} {value}' - print('Special line Characters'.center(40).rstrip()) - print(FMT.format(idx='Index', - name='Name', - value='Value', - col1_width=col1_width, - col2_width=col2_width)) - print('{0} {1} {2}'.format('-' * col1_width, - '-' * col2_width, - '-' * 10)) - for index_name, name in index.items(): - try: - index = getattr(termios, index_name) - value = cc[index] - if value == b'\xff': - value = '_POSIX_VDISABLE' - else: - value = repr(value) - except AttributeError: - value = 'undef' - print(FMT.format(idx=index_name, - name=name, - value=value, - col1_width=col1_width, - col2_width=col2_width)) - print() - - -def display_conf(kind, names, getter): - col1_width = max(map(len, names)) - FMT = '{name:>{col1_width}} {value}' - print(FMT.format(name=kind, - value='value', - col1_width=col1_width)) - print('{0} {1}'.format('-' * col1_width, '-' * 27)) - for name in names: - try: - value = getter(name) - except OSError as err: - value = err - print(FMT.format(name=name, value=value, col1_width=col1_width)) - print() - - -def main(): - fd = sys.stdin.fileno() - locale.setlocale(locale.LC_ALL, '') - encoding = locale.getpreferredencoding() - - print('os.isatty({0}) => {1}'.format(fd, os.isatty(fd))) - print('locale.getpreferredencoding() => {0}'.format(encoding)) - - display_conf(kind='pathconf', - names=os.pathconf_names, - getter=lambda name: os.fpathconf(fd, name)) - - try: - (iflag, oflag, cflag, lflag, ispeed, ospeed, cc - ) = termios.tcgetattr(fd) - except termios.error as err: - print('stdin is not a typewriter: {0}'.format(err)) - else: - display_bitmask(kind='Input Mode', - bitmap=BITMAP_IFLAG, - value=iflag) - display_bitmask(kind='Output Mode', - bitmap=BITMAP_OFLAG, - value=oflag) - display_bitmask(kind='Control Mode', - bitmap=BITMAP_CFLAG, - value=cflag) - display_bitmask(kind='Local Mode', - bitmap=BITMAP_LFLAG, - value=lflag) - display_ctl_chars(index=CTLCHAR_INDEX, - cc=cc) - print('os.ttyname({0}) => {1}'.format(fd, os.ttyname(fd))) - print('os.ctermid() => {0}'.format(os.ttyname(fd))) - - -if __name__ == '__main__': - main() From ced259a3c27e08cb57637c6b41f12fdba566701d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 7 Oct 2015 08:58:47 +0200 Subject: [PATCH 10/34] add forgotten patches Signed-off-by: Igor Gnatenko --- ...max-canon-tests-retain-file-contents.patch | 53 +++ ...tools-display-fpathconf.maxcanon-.py.patch | 371 ++++++++++++++++++ pexpect-4.0.1-disable-some-tests.patch | 10 + 3 files changed, 434 insertions(+) create mode 100644 0001-disable-max-canon-tests-retain-file-contents.patch create mode 100644 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch create mode 100644 pexpect-4.0.1-disable-some-tests.patch diff --git a/0001-disable-max-canon-tests-retain-file-contents.patch b/0001-disable-max-canon-tests-retain-file-contents.patch new file mode 100644 index 0000000..766f12f --- /dev/null +++ b/0001-disable-max-canon-tests-retain-file-contents.patch @@ -0,0 +1,53 @@ +From 0b7fee3c974d89b7f7f51fef9a1893e25ed980da Mon Sep 17 00:00:00 2001 +From: Jeff Quast +Date: Tue, 6 Oct 2015 08:08:05 -0700 +Subject: [PATCH 1/2] disable max canon tests, retain file contents + +--- + tests/test_maxcanon.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py +index 772a3b7..cd48cbc 100644 +--- a/tests/test_maxcanon.py ++++ b/tests/test_maxcanon.py +@@ -27,6 +27,9 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): + implement this bit, and acts as if it is always set." Although these + tests ensure it is enabled, this is a non-op for Linux. + ++ More unsettling in regards to Linux, Fedora and Debian have different ++ behaviours. For this reason, **these test has been disabled entirely**. ++ + FreeBSD supports neither, and instead uses a fraction (1/5) of the tty + speed which is always 9600. Therefor, the maximum limited input line + length is 9600 / 5 = 1920. +@@ -63,7 +66,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): + sys.platform.lower().startswith('freebsd'), + reason='os.write to BLOCK indefinitely on FreeBSD in this case' + ) +- def test_under_max_canon(self): ++ def disabled_under_max_canon(self): + " BEL is not sent by terminal driver at maximum bytes - 1. " + # given, + child = pexpect.spawn('bash', echo=self.echo, timeout=5) +@@ -101,7 +104,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): + sys.platform.lower().startswith('freebsd'), + reason='os.write to BLOCK indefinitely on FreeBSD in this case' + ) +- def test_beyond_max_icanon(self): ++ def disabled_beyond_max_icanon(self): + " a single BEL is sent when maximum bytes is reached. " + # given, + child = pexpect.spawn('bash', echo=self.echo, timeout=5) +@@ -140,7 +143,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): + sys.platform.lower().startswith('freebsd'), + reason='os.write to BLOCK indefinitely on FreeBSD in this case' + ) +- def test_max_no_icanon(self): ++ def disabled_max_no_icanon(self): + " may exceed maximum input bytes if canonical mode is disabled. " + # given, + child = pexpect.spawn('bash', echo=self.echo, timeout=5) +-- +2.6.1 + diff --git a/0002-2-new-tools-display-fpathconf.maxcanon-.py.patch b/0002-2-new-tools-display-fpathconf.maxcanon-.py.patch new file mode 100644 index 0000000..6eea31e --- /dev/null +++ b/0002-2-new-tools-display-fpathconf.maxcanon-.py.patch @@ -0,0 +1,371 @@ +From ae932d179adc4c602f9a4298076cdc5a82f9351a Mon Sep 17 00:00:00 2001 +From: Jeff Quast +Date: Tue, 6 Oct 2015 10:17:50 -0700 +Subject: [PATCH 2/2] 2 new tools: display-{fpathconf.maxcanon}.py + +tests/test_maxcanon.py has been deleted and turned into +an "autodetection" tool of sorts, no longer attempting +to assert exacting values, but determine it programmatically. +--- + pexpect/pty_spawn.py | 14 ++-- + tests/test_maxcanon.py | 179 --------------------------------------------- + tools/display-fpathconf.py | 41 +++++++++++ + tools/display-maxcanon.py | 80 ++++++++++++++++++++ + 4 files changed, 128 insertions(+), 186 deletions(-) + delete mode 100644 tests/test_maxcanon.py + create mode 100644 tools/display-fpathconf.py + create mode 100644 tools/display-maxcanon.py + +diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py +index 7fc27fe..299016c 100644 +--- a/pexpect/pty_spawn.py ++++ b/pexpect/pty_spawn.py +@@ -492,9 +492,9 @@ class spawn(SpawnBase): + + This value may be discovered using fpathconf(3):: + +- >>> from os import fpathconf +- >>> print(fpathconf(0, 'PC_MAX_CANON')) +- 256 ++ >>> from os import fpathconf ++ >>> print(fpathconf(0, 'PC_MAX_CANON')) ++ 256 + + On such a system, only 256 bytes may be received per line. Any + subsequent bytes received will be discarded. BEL (``'\a'``) is then +@@ -505,10 +505,10 @@ class spawn(SpawnBase): + Canonical input processing may be disabled altogether by executing + a shell, then stty(1), before executing the final program:: + +- >>> bash = pexpect.spawn('/bin/bash', echo=False) +- >>> bash.sendline('stty -icanon') +- >>> bash.sendline('base64') +- >>> bash.sendline('x' * 5000) ++ >>> bash = pexpect.spawn('/bin/bash', echo=False) ++ >>> bash.sendline('stty -icanon') ++ >>> bash.sendline('base64') ++ >>> bash.sendline('x' * 5000) + ''' + + time.sleep(self.delaybeforesend) +diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py +deleted file mode 100644 +index cd48cbc..0000000 +--- a/tests/test_maxcanon.py ++++ /dev/null +@@ -1,179 +0,0 @@ +-""" Module for canonical-mode tests. """ +-# std imports +-import sys +-import os +- +-# local +-import pexpect +-from . import PexpectTestCase +- +-# 3rd-party +-import pytest +- +- +-class TestCaseCanon(PexpectTestCase.PexpectTestCase): +- """ +- Test expected Canonical mode behavior (limited input line length). +- +- All systems use the value of MAX_CANON which can be found using +- fpathconf(3) value PC_MAX_CANON -- with the exception of Linux +- and FreeBSD. +- +- Linux, though defining a value of 255, actually honors the value +- of 4096 from linux kernel include file tty.h definition +- N_TTY_BUF_SIZE. +- +- Linux also does not honor IMAXBEL. termios(3) states, "Linux does not +- implement this bit, and acts as if it is always set." Although these +- tests ensure it is enabled, this is a non-op for Linux. +- +- More unsettling in regards to Linux, Fedora and Debian have different +- behaviours. For this reason, **these test has been disabled entirely**. +- +- FreeBSD supports neither, and instead uses a fraction (1/5) of the tty +- speed which is always 9600. Therefor, the maximum limited input line +- length is 9600 / 5 = 1920. +- +- These tests only ensure the correctness of the behavior described by +- the sendline() docstring. pexpect is not particularly involved in +- these scenarios, though if we wish to expose some kind of interface +- to tty.setraw, for example, these tests may be re-purposed as such. +- +- Lastly, portions of these tests are skipped on Travis-CI. It produces +- unexpected behavior not reproduced on Debian/GNU Linux. +- """ +- +- def setUp(self): +- super(TestCaseCanon, self).setUp() +- +- self.echo = False +- if sys.platform.lower().startswith('linux'): +- # linux is 4096, N_TTY_BUF_SIZE. +- self.max_input = 4096 +- self.echo = True +- elif sys.platform.lower().startswith('sunos'): +- # SunOS allows PC_MAX_CANON + 1; see +- # https://bitbucket.org/illumos/illumos-gate/src/d07a59219ab7fd2a7f39eb47c46cf083c88e932f/usr/src/uts/common/io/ldterm.c?at=default#cl-1888 +- self.max_input = os.fpathconf(0, 'PC_MAX_CANON') + 1 +- elif sys.platform.lower().startswith('freebsd'): +- # http://lists.freebsd.org/pipermail/freebsd-stable/2009-October/052318.html +- self.max_input = 9600 / 5 +- else: +- # All others (probably) limit exactly at PC_MAX_CANON +- self.max_input = os.fpathconf(0, 'PC_MAX_CANON') +- +- @pytest.mark.skipif( +- sys.platform.lower().startswith('freebsd'), +- reason='os.write to BLOCK indefinitely on FreeBSD in this case' +- ) +- def disabled_under_max_canon(self): +- " BEL is not sent by terminal driver at maximum bytes - 1. " +- # given, +- child = pexpect.spawn('bash', echo=self.echo, timeout=5) +- child.sendline('echo READY') +- child.sendline('stty icanon imaxbel') +- child.sendline('echo BEGIN; cat') +- +- # some systems BEL on (maximum - 1), not able to receive CR, +- # even though all characters up until then were received, they +- # simply cannot be transmitted, as CR is part of the transmission. +- send_bytes = self.max_input - 1 +- +- # exercise, +- child.sendline('_' * send_bytes) +- +- # fast forward beyond 'cat' command, as ^G can be found as part of +- # set-xterm-title sequence of $PROMPT_COMMAND or $PS1. +- child.expect_exact('BEGIN') +- +- # verify, all input is found in echo output, +- child.expect_exact('_' * send_bytes) +- +- # BEL is not found, +- with self.assertRaises(pexpect.TIMEOUT): +- child.expect_exact('\a', timeout=1) +- +- # cleanup, +- child.sendeof() # exit cat(1) +- child.sendline('exit 0') # exit bash(1) +- child.expect(pexpect.EOF) +- assert not child.isalive() +- assert child.exitstatus == 0 +- +- @pytest.mark.skipif( +- sys.platform.lower().startswith('freebsd'), +- reason='os.write to BLOCK indefinitely on FreeBSD in this case' +- ) +- def disabled_beyond_max_icanon(self): +- " a single BEL is sent when maximum bytes is reached. " +- # given, +- child = pexpect.spawn('bash', echo=self.echo, timeout=5) +- child.sendline('stty icanon imaxbel erase ^H') +- child.sendline('cat') +- send_bytes = self.max_input +- +- # exercise, +- child.sendline('_' * send_bytes) +- child.expect_exact('\a') +- +- # exercise, we must now backspace to send CR. +- child.sendcontrol('h') +- child.sendline() +- +- if os.environ.get('TRAVIS', None) == 'true': +- # Travis-CI has intermittent behavior here, possibly +- # because the master process is itself, a PTY? +- return +- +- # verify the length of (maximum - 1) received by cat(1), +- # which has written it back out, +- child.expect_exact('_' * (send_bytes - 1)) +- # and not a byte more. +- with self.assertRaises(pexpect.TIMEOUT): +- child.expect_exact('_', timeout=1) +- +- # cleanup, +- child.sendeof() # exit cat(1) +- child.sendline('exit 0') # exit bash(1) +- child.expect_exact(pexpect.EOF) +- assert not child.isalive() +- assert child.exitstatus == 0 +- +- @pytest.mark.skipif( +- sys.platform.lower().startswith('freebsd'), +- reason='os.write to BLOCK indefinitely on FreeBSD in this case' +- ) +- def disabled_max_no_icanon(self): +- " may exceed maximum input bytes if canonical mode is disabled. " +- # given, +- child = pexpect.spawn('bash', echo=self.echo, timeout=5) +- child.sendline('stty -icanon imaxbel') +- child.sendline('echo BEGIN; cat') +- send_bytes = self.max_input + 11 +- +- # exercise, +- child.sendline('_' * send_bytes) +- +- # fast forward beyond 'cat' command, as ^G can be found as part of +- # set-xterm-title sequence of $PROMPT_COMMAND or $PS1. +- child.expect_exact('BEGIN') +- +- if os.environ.get('TRAVIS', None) == 'true': +- # Travis-CI has intermittent behavior here, possibly +- # because the master process is itself, a PTY? +- return +- +- # BEL is *not* found, +- with self.assertRaises(pexpect.TIMEOUT): +- child.expect_exact('\a', timeout=1) +- +- # verify, all input is found in output, +- child.expect_exact('_' * send_bytes) +- +- # cleanup, +- child.sendcontrol('c') # exit cat(1) (eof wont work in -icanon) +- child.sendcontrol('c') +- child.sendline('exit 0') # exit bash(1) +- child.expect(pexpect.EOF) +- assert not child.isalive() +- assert child.exitstatus == 0 +diff --git a/tools/display-fpathconf.py b/tools/display-fpathconf.py +new file mode 100644 +index 0000000..d40cbae +--- /dev/null ++++ b/tools/display-fpathconf.py +@@ -0,0 +1,41 @@ ++#!/usr/bin/env python ++"""Displays os.fpathconf values related to terminals. """ ++from __future__ import print_function ++import sys ++import os ++ ++ ++def display_fpathconf(): ++ DISP_VALUES = ( ++ ('PC_MAX_CANON', ('Max no. of bytes in a ' ++ 'terminal canonical input line.')), ++ ('PC_MAX_INPUT', ('Max no. of bytes for which ' ++ 'space is available in a terminal input queue.')), ++ ('PC_PIPE_BUF', ('Max no. of bytes which will ' ++ 'be written atomically to a pipe.')), ++ ('PC_VDISABLE', 'Terminal character disabling value.') ++ ) ++ FMT = '{name:<13} {value:<5} {description}' ++ ++ # column header ++ print(FMT.format(name='name', value='value', description='description')) ++ print(FMT.format(name=('-' * 13), value=('-' * 5), description=('-' * 11))) ++ ++ fd = sys.stdin.fileno() ++ for name, description in DISP_VALUES: ++ key = os.pathconf_names.get(name, None) ++ if key is None: ++ value = 'UNDEF' ++ else: ++ try: ++ value = os.fpathconf(fd, name) ++ except OSError as err: ++ value = 'OSErrno {0.errno}'.format(err) ++ if name == 'PC_VDISABLE': ++ value = hex(value) ++ print(FMT.format(name=name, value=value, description=description)) ++ print() ++ ++ ++if __name__ == '__main__': ++ display_fpathconf() +diff --git a/tools/display-maxcanon.py b/tools/display-maxcanon.py +new file mode 100644 +index 0000000..cbd664f +--- /dev/null ++++ b/tools/display-maxcanon.py +@@ -0,0 +1,80 @@ ++#!/usr/bin/env python ++""" ++This tool uses pexpect to test expected Canonical mode length. ++ ++All systems use the value of MAX_CANON which can be found using ++fpathconf(3) value PC_MAX_CANON -- with the exception of Linux ++and FreeBSD. ++ ++Linux, though defining a value of 255, actually honors the value ++of 4096 from linux kernel include file tty.h definition ++N_TTY_BUF_SIZE. ++ ++Linux also does not honor IMAXBEL. termios(3) states, "Linux does not ++implement this bit, and acts as if it is always set." Although these ++tests ensure it is enabled, this is a non-op for Linux. ++ ++FreeBSD supports neither, and instead uses a fraction (1/5) of the tty ++speed which is always 9600. Therefor, the maximum limited input line ++length is 9600 / 5 = 1920. ++ ++These tests only ensure the correctness of the behavior described by ++the sendline() docstring -- the values listed there, and above should ++be equal to the output of the given OS described, but no promises! ++""" ++# std import ++from __future__ import print_function ++import sys ++import os ++ ++ ++def detect_maxcanon(): ++ import pexpect ++ bashrc = os.path.join( ++ # re-use pexpect/replwrap.py's bashrc file, ++ os.path.dirname(__file__), os.path.pardir, 'pexpect', 'bashrc.sh') ++ ++ child = pexpect.spawn('bash', ['--rcfile', bashrc], ++ echo=True, encoding='utf8', timeout=3) ++ ++ child.sendline(u'echo -n READY_; echo GO') ++ child.expect_exact(u'READY_GO') ++ ++ child.sendline(u'stty icanon imaxbel erase ^H; echo -n retval: $?') ++ child.expect_exact(u'retval: 0') ++ ++ child.sendline(u'echo -n GO_; echo AGAIN') ++ child.expect_exact(u'GO_AGAIN') ++ child.sendline(u'cat') ++ ++ child.delaybeforesend = 0 ++ ++ column, blocksize = 0, 64 ++ ch_marker = u'_' ++ ++ print('auto-detecting MAX_CANON: ', end='') ++ sys.stdout.flush() ++ ++ while True: ++ child.send(ch_marker * blocksize) ++ result = child.expect([ch_marker * blocksize, u'\a']) ++ if result == 0: ++ # entire block fit without emitting bel ++ column += blocksize ++ elif result == 1: ++ # an '\a' was emitted, count the number of ch_markers ++ # found since last blocksize, determining our MAX_CANON ++ column += child.before.count(ch_marker) ++ break ++ print(column) ++ ++if __name__ == '__main__': ++ try: ++ detect_maxcanon() ++ except ImportError: ++ # we'd like to use this with CI -- but until we integrate ++ # with tox, we can't determine a period in testing when ++ # the pexpect module has been installed ++ print('warning: pexpect not in module path, MAX_CANON ' ++ 'could not be determined by systems test.', ++ file=sys.stderr) +-- +2.6.1 + diff --git a/pexpect-4.0.1-disable-some-tests.patch b/pexpect-4.0.1-disable-some-tests.patch new file mode 100644 index 0000000..a553e30 --- /dev/null +++ b/pexpect-4.0.1-disable-some-tests.patch @@ -0,0 +1,10 @@ +diff --git a/tests/test_async.py b/tests/test_async.py +index ce75572..7bee98f 100644 +--- a/tests/test_async.py ++++ b/tests/test_async.py +@@ -48,4 +48,4 @@ class AsyncTests(PexpectTestCase): + p = pexpect.spawn('%s list100.py' % sys.executable) + assert run(p.expect_exact(b'5', async=True)) == 0 + assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 +- assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 ++ #assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 From e4689f3eb1462d537486131ed9fbecd200f61063 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 8 Oct 2015 16:47:11 +0200 Subject: [PATCH 11/34] Fix RPM macroses Signed-off-by: Igor Gnatenko --- python-pexpect.spec | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 052bd8c..76f1a96 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz @@ -32,11 +32,12 @@ does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module. -%package -n python2-pexpect +%package -n python2-%{modname} Summary: Unicode-aware Pure Python Expect-like module for Python 2 BuildRequires: python2-devel BuildRequires: python2-pytest python-ptyprocess Requires: python-ptyprocess +%{?python_provide:%python_provide python2-%{modname}} %description -n python2-pexpect Pexpect is a pure Python module for spawning child applications; controlling @@ -54,11 +55,12 @@ does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module. -%package -n python3-pexpect +%package -n python3-%{modname} Summary: Unicode-aware Pure Python Expect-like module for Python 3 BuildRequires: python3-devel BuildRequires: python3-pytest python3-ptyprocess Requires: python3-ptyprocess +%{?python_provide:%python_provide python3-%{modname}} %description -n python3-pexpect Pexpect is a pure Python module for spawning child applications; controlling @@ -122,17 +124,20 @@ pushd %{py3dir} py.test-3 --verbose popd -%files +%files -n python2-%{modname} %license LICENSE %doc doc examples %{python2_sitelib}/%{modname}* -%files -n python3-pexpect +%files -n python3-%{modname} %license LICENSE %doc doc examples %{python3_sitelib}/%{modname}* %changelog +* Thu Oct 08 2015 Igor Gnatenko - 4.0.1-2 +- Fix RPM macroses + * Tue Oct 06 2015 Igor Gnatenko - 4.0.1-1 - Update to 4.0.1 From f5c1ad4f498a1c66c2cc21dc0243cfd438ba7c68 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 13 Oct 2015 17:24:09 +0200 Subject: [PATCH 12/34] Fix asyncio issue (3.4.3+) Signed-off-by: Igor Gnatenko --- ...tening-to-pty-once-we-ve-found-what-.patch | 41 +++++++++++++++++++ pexpect-4.0.1-disable-some-tests.patch | 10 ----- python-pexpect.spec | 7 +++- 3 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch delete mode 100644 pexpect-4.0.1-disable-some-tests.patch diff --git a/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch b/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch new file mode 100644 index 0000000..b84b4ce --- /dev/null +++ b/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch @@ -0,0 +1,41 @@ +From 5e6e0ad21acfed32c57ae8ef23a8a0722869afe1 Mon Sep 17 00:00:00 2001 +From: Thomas Kluyver +Date: Tue, 13 Oct 2015 12:41:09 +0100 +Subject: [PATCH] Stop asyncio listening to pty once we've found what we need + +Closes gh-213 (fingers crossed) +--- + pexpect/async.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/pexpect/async.py b/pexpect/async.py +index a798457..136fc0e 100644 +--- a/pexpect/async.py ++++ b/pexpect/async.py +@@ -23,6 +23,7 @@ def expect_async(expecter, timeout=None): + return expecter.timeout(e) + + class PatternWaiter(asyncio.Protocol): ++ transport = None + def __init__(self, expecter): + self.expecter = expecter + self.fut = asyncio.Future() +@@ -30,10 +31,15 @@ class PatternWaiter(asyncio.Protocol): + def found(self, result): + if not self.fut.done(): + self.fut.set_result(result) ++ self.transport.pause_reading() + + def error(self, exc): + if not self.fut.done(): + self.fut.set_exception(exc) ++ self.transport.pause_reading() ++ ++ def connection_made(self, transport): ++ self.transport = transport + + def data_received(self, data): + spawn = self.expecter.spawn +-- +2.6.1 + diff --git a/pexpect-4.0.1-disable-some-tests.patch b/pexpect-4.0.1-disable-some-tests.patch deleted file mode 100644 index a553e30..0000000 --- a/pexpect-4.0.1-disable-some-tests.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/tests/test_async.py b/tests/test_async.py -index ce75572..7bee98f 100644 ---- a/tests/test_async.py -+++ b/tests/test_async.py -@@ -48,4 +48,4 @@ class AsyncTests(PexpectTestCase): - p = pexpect.spawn('%s list100.py' % sys.executable) - assert run(p.expect_exact(b'5', async=True)) == 0 - assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 -- assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 -+ #assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 diff --git a/python-pexpect.spec b/python-pexpect.spec index 76f1a96..68d7210 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,12 +3,12 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz -Patch0: pexpect-4.0.1-disable-some-tests.patch +Patch0: 0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch Patch1: 0001-disable-max-canon-tests-retain-file-contents.patch Patch2: 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch @@ -135,6 +135,9 @@ popd %{python3_sitelib}/%{modname}* %changelog +* Tue Oct 13 2015 Igor Gnatenko - 4.0.1-3 +- Fix asyncio issue (3.4.3+) + * Thu Oct 08 2015 Igor Gnatenko - 4.0.1-2 - Fix RPM macroses From b7fa9fcc03515e5f3e04752906d6eb8533626545 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sun, 18 Oct 2015 13:59:14 +0200 Subject: [PATCH 13/34] Move pexpect provides to the right subpackage Now that we have python2-pexpect instead of python-pexpect, move "Provides: pexpect" to the new subpackage as well. --- python-pexpect.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 68d7210..47e275f 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz @@ -14,8 +14,6 @@ Patch2: 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch BuildArch: noarch BuildRequires: git-core -Provides: pexpect = %{version}-%{release} -Obsoletes: pexpect <= 2.3-20 %description Pexpect is a pure Python module for spawning child applications; controlling @@ -37,6 +35,8 @@ Summary: Unicode-aware Pure Python Expect-like module for Python 2 BuildRequires: python2-devel BuildRequires: python2-pytest python-ptyprocess Requires: python-ptyprocess +Provides: pexpect = %{version}-%{release} +Obsoletes: pexpect <= 2.3-20 %{?python_provide:%python_provide python2-%{modname}} %description -n python2-pexpect @@ -135,6 +135,9 @@ popd %{python3_sitelib}/%{modname}* %changelog +* Sun Oct 18 2015 Kalev Lember - 4.0.1-4 +- Move pexpect provides to the right subpackage + * Tue Oct 13 2015 Igor Gnatenko - 4.0.1-3 - Fix asyncio issue (3.4.3+) From 26f6636990c2121894da05b09c69ced445da307d Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 10 Nov 2015 16:41:07 +0000 Subject: [PATCH 14/34] - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 47e275f..ec9a44f 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz @@ -135,6 +135,9 @@ popd %{python3_sitelib}/%{modname}* %changelog +* Tue Nov 10 2015 Fedora Release Engineering - 4.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + * Sun Oct 18 2015 Kalev Lember - 4.0.1-4 - Move pexpect provides to the right subpackage From c0c6019c9f962603e4d68bb487070d3847b69abd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 4 Feb 2016 20:28:10 +0000 Subject: [PATCH 15/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index ec9a44f..1a82802 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 5%{?dist} +Release: 6%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz @@ -135,6 +135,9 @@ popd %{python3_sitelib}/%{modname}* %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 4.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Tue Nov 10 2015 Fedora Release Engineering - 4.0.1-5 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 From f85f6111a0840a40b2fa0dab7d543d2a0dc27ca0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 30 Jun 2016 10:25:00 +0200 Subject: [PATCH 16/34] Update to 4.1.0; Improve packaging Signed-off-by: Igor Gnatenko --- .gitignore | 1 + python-pexpect.spec | 110 ++++++++++++++++++++++++-------------------- sources | 2 +- 3 files changed, 61 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index 666884d..5e9be72 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ pexpect-2.3.tar.gz /pexpect-3.1.tar.gz /pexpect-4.0.tar.gz /pexpect-4.0.1.tar.gz +/pexpect-4.1.0.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index 1a82802..a155cca 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -1,19 +1,15 @@ %global modname pexpect -Summary: Unicode-aware Pure Python Expect-like module -Name: python-%{modname} -Version: 4.0.1 -Release: 6%{?dist} -License: MIT -URL: https://github.com/%{modname}/%{modname} -Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz +Name: python-%{modname} +Summary: Unicode-aware Pure Python Expect-like module +Version: 4.1.0 +Release: 1%{?dist} -Patch0: 0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch -Patch1: 0001-disable-max-canon-tests-retain-file-contents.patch -Patch2: 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch +License: MIT +URL: https://github.com/%{modname}/%{modname} +Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz -BuildArch: noarch -BuildRequires: git-core +BuildArch: noarch %description Pexpect is a pure Python module for spawning child applications; controlling @@ -31,13 +27,14 @@ compiled. It should work on any platform that supports the standard Python pty module. %package -n python2-%{modname} -Summary: Unicode-aware Pure Python Expect-like module for Python 2 -BuildRequires: python2-devel -BuildRequires: python2-pytest python-ptyprocess -Requires: python-ptyprocess -Provides: pexpect = %{version}-%{release} -Obsoletes: pexpect <= 2.3-20 +Summary: %{summary} %{?python_provide:%python_provide python2-%{modname}} +BuildRequires: python2-devel +BuildRequires: python2-pytest +BuildRequires: python2-ptyprocess +Requires: python2-ptyprocess +Provides: pexpect = %{version}-%{release} +Obsoletes: pexpect <= 2.3-20 %description -n python2-pexpect Pexpect is a pure Python module for spawning child applications; controlling @@ -56,13 +53,14 @@ compiled. It should work on any platform that supports the standard Python pty module. %package -n python3-%{modname} -Summary: Unicode-aware Pure Python Expect-like module for Python 3 -BuildRequires: python3-devel -BuildRequires: python3-pytest python3-ptyprocess -Requires: python3-ptyprocess +Summary: %{summary} %{?python_provide:%python_provide python3-%{modname}} +BuildRequires: python3-devel +BuildRequires: python3-pytest +BuildRequires: python3-ptyprocess +Requires: python3-ptyprocess -%description -n python3-pexpect +%description -n python3-%{modname} Pexpect is a pure Python module for spawning child applications; controlling them; and responding to expected patterns in their output. Pexpect works like Don Libes' Expect. Pexpect allows your script to spawn a child application and @@ -79,32 +77,34 @@ compiled. It should work on any platform that supports the standard Python pty module. %prep -%autosetup -n %{modname}-%{version} -S git -chmod +x ./tools/* -#sed -i "s/0.1/10.0/g" tests/test_misc.py +%autosetup -c +mv %{modname}-%{version} python2 +chmod +x python2/tools/* +find python2/examples -type f | xargs chmod a-x +cp -pr python2 python3 -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +find python2 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|' +find python3 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|' %build -%py2_build +pushd python2 + %py2_build +popd -pushd %{py3dir} +pushd python3 %py3_build popd %install -%py2_install -rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests -# Correct some permissions -find examples -type f -exec chmod a-x \{\} \; -rm -f %{buildroot}%{python2_sitelib}/%{modname}/async.py +pushd python2 + %py2_install + rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests + # Drop asyncio stuff from py2 + rm -f %{buildroot}%{python2_sitelib}/%{modname}/async.py +popd -pushd %{py3dir} +pushd python3 %py3_install - # Correct some permissions - find examples -type f -exec chmod a-x \{\} \; rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests popd @@ -112,29 +112,37 @@ popd export PYTHONIOENCODING=UTF-8 export LC_ALL="en_US.UTF-8" -%{__python2} ./tools/display-sighandlers.py -%{__python2} ./tools/display-terminalinfo.py -PYTHONPATH=`pwd` %{__python2} ./tools/display-maxcanon.py -py.test-2 --verbose +pushd python2 + %{__python2} ./tools/display-sighandlers.py + %{__python2} ./tools/display-terminalinfo.py + PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} ./tools/display-maxcanon.py + py.test-2 --verbose +popd -pushd %{py3dir} +pushd python3 %{__python3} ./tools/display-sighandlers.py %{__python3} ./tools/display-terminalinfo.py - PYTHONPATH=`pwd` %{__python3} ./tools/display-maxcanon.py + PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py py.test-3 --verbose popd %files -n python2-%{modname} -%license LICENSE -%doc doc examples -%{python2_sitelib}/%{modname}* +%license python2/LICENSE +%doc python2/doc python2/examples +%{python2_sitelib}/%{modname}/ +%{python2_sitelib}/%{modname}-*.egg-info %files -n python3-%{modname} -%license LICENSE -%doc doc examples -%{python3_sitelib}/%{modname}* +%license python3/LICENSE +%doc python3/doc python3/examples +%{python3_sitelib}/%{modname}/ +%{python3_sitelib}/%{modname}-*.egg-info %changelog +* Thu Jun 30 2016 Igor Gnatenko - 4.1.0-1 +- Update to 4.1.0 +- Improve packaging + * Thu Feb 04 2016 Fedora Release Engineering - 4.0.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 4f96121..4e6a116 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2bd260f7f2159f9bcab373721736d526 pexpect-4.0.1.tar.gz +049f3c98f4b0b7426e6b5d8a01566786 pexpect-4.1.0.tar.gz From be11bb73186d46055a78bf4bfeb10ff4e419250b Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 30 Jun 2016 10:33:47 +0200 Subject: [PATCH 17/34] add missing BRs Signed-off-by: Igor Gnatenko --- python-pexpect.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python-pexpect.spec b/python-pexpect.spec index a155cca..8de0921 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -9,6 +9,9 @@ License: MIT URL: https://github.com/%{modname}/%{modname} Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz +BuildRequires: /usr/bin/man +BuildRequires: coreutils + BuildArch: noarch %description From e5e0e577b4deb9d562540b3dc0baab862ca9db9d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 10:56:42 +0000 Subject: [PATCH 18/34] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 8de0921..f0c4d0b 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.1.0 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 4.1.0-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Thu Jun 30 2016 Igor Gnatenko - 4.1.0-1 - Update to 4.1.0 - Improve packaging From e05eebac30b940bfd976b286b1df71cb3d511942 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 13 Dec 2016 17:01:23 +0100 Subject: [PATCH 19/34] Rebuild for Python 3.6 --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index f0c4d0b..7c7158c 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.1.0 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Tue Dec 13 2016 Stratakis Charalampos - 4.1.0-3 +- Rebuild for Python 3.6 + * Tue Jul 19 2016 Fedora Release Engineering - 4.1.0-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages From a3d82441e3c4feb10ac3bad11d62fcef0111ada9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 09:56:08 +0000 Subject: [PATCH 20/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 7c7158c..2a83c49 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.1.0 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: https://github.com/%{modname}/%{modname} @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 4.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Tue Dec 13 2016 Stratakis Charalampos - 4.1.0-3 - Rebuild for Python 3.6 From 0c74cf838c2d3b032fb5fdf934b3cacb0947e591 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 14 Feb 2017 10:27:29 +0100 Subject: [PATCH 21/34] Update to 4.2.1 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + ...and-line-args-for-unicode-mode-spawn.patch | 29 -- ...tening-to-pty-once-we-ve-found-what-.patch | 41 -- ...max-canon-tests-retain-file-contents.patch | 53 --- ...tools-display-fpathconf.maxcanon-.py.patch | 371 ------------------ python-pexpect.spec | 11 +- sources | 2 +- 7 files changed, 9 insertions(+), 499 deletions(-) delete mode 100644 0001-Encode-command-line-args-for-unicode-mode-spawn.patch delete mode 100644 0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch delete mode 100644 0001-disable-max-canon-tests-retain-file-contents.patch delete mode 100644 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch diff --git a/.gitignore b/.gitignore index 5e9be72..0b006c5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ pexpect-2.3.tar.gz /pexpect-4.0.tar.gz /pexpect-4.0.1.tar.gz /pexpect-4.1.0.tar.gz +/pexpect-4.2.1.tar.gz diff --git a/0001-Encode-command-line-args-for-unicode-mode-spawn.patch b/0001-Encode-command-line-args-for-unicode-mode-spawn.patch deleted file mode 100644 index abb3bda..0000000 --- a/0001-Encode-command-line-args-for-unicode-mode-spawn.patch +++ /dev/null @@ -1,29 +0,0 @@ -From fa5ece24786d659e0bcd8423d66cbaa51b3d8d6c Mon Sep 17 00:00:00 2001 -From: Thomas Kluyver -Date: Tue, 6 Oct 2015 11:30:10 +0100 -Subject: [PATCH] Encode command line args for unicode-mode spawn - -Attempt to address gh-272 ---- - pexpect/pty_spawn.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py -index 1d9554b..7fc27fe 100644 ---- a/pexpect/pty_spawn.py -+++ b/pexpect/pty_spawn.py -@@ -285,6 +285,11 @@ class spawn(SpawnBase): - if dimensions is not None: - kwargs['dimensions'] = dimensions - -+ if self.encoding is not None: -+ # Encode command line using the specified encoding -+ self.args = [a if isinstance(a, bytes) else a.encode(self.encoding) -+ for a in self.args] -+ - self.ptyproc = ptyprocess.PtyProcess.spawn(self.args, env=self.env, - cwd=self.cwd, **kwargs) - --- -2.6.0 - diff --git a/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch b/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch deleted file mode 100644 index b84b4ce..0000000 --- a/0001-Stop-asyncio-listening-to-pty-once-we-ve-found-what-.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 5e6e0ad21acfed32c57ae8ef23a8a0722869afe1 Mon Sep 17 00:00:00 2001 -From: Thomas Kluyver -Date: Tue, 13 Oct 2015 12:41:09 +0100 -Subject: [PATCH] Stop asyncio listening to pty once we've found what we need - -Closes gh-213 (fingers crossed) ---- - pexpect/async.py | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/pexpect/async.py b/pexpect/async.py -index a798457..136fc0e 100644 ---- a/pexpect/async.py -+++ b/pexpect/async.py -@@ -23,6 +23,7 @@ def expect_async(expecter, timeout=None): - return expecter.timeout(e) - - class PatternWaiter(asyncio.Protocol): -+ transport = None - def __init__(self, expecter): - self.expecter = expecter - self.fut = asyncio.Future() -@@ -30,10 +31,15 @@ class PatternWaiter(asyncio.Protocol): - def found(self, result): - if not self.fut.done(): - self.fut.set_result(result) -+ self.transport.pause_reading() - - def error(self, exc): - if not self.fut.done(): - self.fut.set_exception(exc) -+ self.transport.pause_reading() -+ -+ def connection_made(self, transport): -+ self.transport = transport - - def data_received(self, data): - spawn = self.expecter.spawn --- -2.6.1 - diff --git a/0001-disable-max-canon-tests-retain-file-contents.patch b/0001-disable-max-canon-tests-retain-file-contents.patch deleted file mode 100644 index 766f12f..0000000 --- a/0001-disable-max-canon-tests-retain-file-contents.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0b7fee3c974d89b7f7f51fef9a1893e25ed980da Mon Sep 17 00:00:00 2001 -From: Jeff Quast -Date: Tue, 6 Oct 2015 08:08:05 -0700 -Subject: [PATCH 1/2] disable max canon tests, retain file contents - ---- - tests/test_maxcanon.py | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py -index 772a3b7..cd48cbc 100644 ---- a/tests/test_maxcanon.py -+++ b/tests/test_maxcanon.py -@@ -27,6 +27,9 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): - implement this bit, and acts as if it is always set." Although these - tests ensure it is enabled, this is a non-op for Linux. - -+ More unsettling in regards to Linux, Fedora and Debian have different -+ behaviours. For this reason, **these test has been disabled entirely**. -+ - FreeBSD supports neither, and instead uses a fraction (1/5) of the tty - speed which is always 9600. Therefor, the maximum limited input line - length is 9600 / 5 = 1920. -@@ -63,7 +66,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): - sys.platform.lower().startswith('freebsd'), - reason='os.write to BLOCK indefinitely on FreeBSD in this case' - ) -- def test_under_max_canon(self): -+ def disabled_under_max_canon(self): - " BEL is not sent by terminal driver at maximum bytes - 1. " - # given, - child = pexpect.spawn('bash', echo=self.echo, timeout=5) -@@ -101,7 +104,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): - sys.platform.lower().startswith('freebsd'), - reason='os.write to BLOCK indefinitely on FreeBSD in this case' - ) -- def test_beyond_max_icanon(self): -+ def disabled_beyond_max_icanon(self): - " a single BEL is sent when maximum bytes is reached. " - # given, - child = pexpect.spawn('bash', echo=self.echo, timeout=5) -@@ -140,7 +143,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase): - sys.platform.lower().startswith('freebsd'), - reason='os.write to BLOCK indefinitely on FreeBSD in this case' - ) -- def test_max_no_icanon(self): -+ def disabled_max_no_icanon(self): - " may exceed maximum input bytes if canonical mode is disabled. " - # given, - child = pexpect.spawn('bash', echo=self.echo, timeout=5) --- -2.6.1 - diff --git a/0002-2-new-tools-display-fpathconf.maxcanon-.py.patch b/0002-2-new-tools-display-fpathconf.maxcanon-.py.patch deleted file mode 100644 index 6eea31e..0000000 --- a/0002-2-new-tools-display-fpathconf.maxcanon-.py.patch +++ /dev/null @@ -1,371 +0,0 @@ -From ae932d179adc4c602f9a4298076cdc5a82f9351a Mon Sep 17 00:00:00 2001 -From: Jeff Quast -Date: Tue, 6 Oct 2015 10:17:50 -0700 -Subject: [PATCH 2/2] 2 new tools: display-{fpathconf.maxcanon}.py - -tests/test_maxcanon.py has been deleted and turned into -an "autodetection" tool of sorts, no longer attempting -to assert exacting values, but determine it programmatically. ---- - pexpect/pty_spawn.py | 14 ++-- - tests/test_maxcanon.py | 179 --------------------------------------------- - tools/display-fpathconf.py | 41 +++++++++++ - tools/display-maxcanon.py | 80 ++++++++++++++++++++ - 4 files changed, 128 insertions(+), 186 deletions(-) - delete mode 100644 tests/test_maxcanon.py - create mode 100644 tools/display-fpathconf.py - create mode 100644 tools/display-maxcanon.py - -diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py -index 7fc27fe..299016c 100644 ---- a/pexpect/pty_spawn.py -+++ b/pexpect/pty_spawn.py -@@ -492,9 +492,9 @@ class spawn(SpawnBase): - - This value may be discovered using fpathconf(3):: - -- >>> from os import fpathconf -- >>> print(fpathconf(0, 'PC_MAX_CANON')) -- 256 -+ >>> from os import fpathconf -+ >>> print(fpathconf(0, 'PC_MAX_CANON')) -+ 256 - - On such a system, only 256 bytes may be received per line. Any - subsequent bytes received will be discarded. BEL (``'\a'``) is then -@@ -505,10 +505,10 @@ class spawn(SpawnBase): - Canonical input processing may be disabled altogether by executing - a shell, then stty(1), before executing the final program:: - -- >>> bash = pexpect.spawn('/bin/bash', echo=False) -- >>> bash.sendline('stty -icanon') -- >>> bash.sendline('base64') -- >>> bash.sendline('x' * 5000) -+ >>> bash = pexpect.spawn('/bin/bash', echo=False) -+ >>> bash.sendline('stty -icanon') -+ >>> bash.sendline('base64') -+ >>> bash.sendline('x' * 5000) - ''' - - time.sleep(self.delaybeforesend) -diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py -deleted file mode 100644 -index cd48cbc..0000000 ---- a/tests/test_maxcanon.py -+++ /dev/null -@@ -1,179 +0,0 @@ --""" Module for canonical-mode tests. """ --# std imports --import sys --import os -- --# local --import pexpect --from . import PexpectTestCase -- --# 3rd-party --import pytest -- -- --class TestCaseCanon(PexpectTestCase.PexpectTestCase): -- """ -- Test expected Canonical mode behavior (limited input line length). -- -- All systems use the value of MAX_CANON which can be found using -- fpathconf(3) value PC_MAX_CANON -- with the exception of Linux -- and FreeBSD. -- -- Linux, though defining a value of 255, actually honors the value -- of 4096 from linux kernel include file tty.h definition -- N_TTY_BUF_SIZE. -- -- Linux also does not honor IMAXBEL. termios(3) states, "Linux does not -- implement this bit, and acts as if it is always set." Although these -- tests ensure it is enabled, this is a non-op for Linux. -- -- More unsettling in regards to Linux, Fedora and Debian have different -- behaviours. For this reason, **these test has been disabled entirely**. -- -- FreeBSD supports neither, and instead uses a fraction (1/5) of the tty -- speed which is always 9600. Therefor, the maximum limited input line -- length is 9600 / 5 = 1920. -- -- These tests only ensure the correctness of the behavior described by -- the sendline() docstring. pexpect is not particularly involved in -- these scenarios, though if we wish to expose some kind of interface -- to tty.setraw, for example, these tests may be re-purposed as such. -- -- Lastly, portions of these tests are skipped on Travis-CI. It produces -- unexpected behavior not reproduced on Debian/GNU Linux. -- """ -- -- def setUp(self): -- super(TestCaseCanon, self).setUp() -- -- self.echo = False -- if sys.platform.lower().startswith('linux'): -- # linux is 4096, N_TTY_BUF_SIZE. -- self.max_input = 4096 -- self.echo = True -- elif sys.platform.lower().startswith('sunos'): -- # SunOS allows PC_MAX_CANON + 1; see -- # https://bitbucket.org/illumos/illumos-gate/src/d07a59219ab7fd2a7f39eb47c46cf083c88e932f/usr/src/uts/common/io/ldterm.c?at=default#cl-1888 -- self.max_input = os.fpathconf(0, 'PC_MAX_CANON') + 1 -- elif sys.platform.lower().startswith('freebsd'): -- # http://lists.freebsd.org/pipermail/freebsd-stable/2009-October/052318.html -- self.max_input = 9600 / 5 -- else: -- # All others (probably) limit exactly at PC_MAX_CANON -- self.max_input = os.fpathconf(0, 'PC_MAX_CANON') -- -- @pytest.mark.skipif( -- sys.platform.lower().startswith('freebsd'), -- reason='os.write to BLOCK indefinitely on FreeBSD in this case' -- ) -- def disabled_under_max_canon(self): -- " BEL is not sent by terminal driver at maximum bytes - 1. " -- # given, -- child = pexpect.spawn('bash', echo=self.echo, timeout=5) -- child.sendline('echo READY') -- child.sendline('stty icanon imaxbel') -- child.sendline('echo BEGIN; cat') -- -- # some systems BEL on (maximum - 1), not able to receive CR, -- # even though all characters up until then were received, they -- # simply cannot be transmitted, as CR is part of the transmission. -- send_bytes = self.max_input - 1 -- -- # exercise, -- child.sendline('_' * send_bytes) -- -- # fast forward beyond 'cat' command, as ^G can be found as part of -- # set-xterm-title sequence of $PROMPT_COMMAND or $PS1. -- child.expect_exact('BEGIN') -- -- # verify, all input is found in echo output, -- child.expect_exact('_' * send_bytes) -- -- # BEL is not found, -- with self.assertRaises(pexpect.TIMEOUT): -- child.expect_exact('\a', timeout=1) -- -- # cleanup, -- child.sendeof() # exit cat(1) -- child.sendline('exit 0') # exit bash(1) -- child.expect(pexpect.EOF) -- assert not child.isalive() -- assert child.exitstatus == 0 -- -- @pytest.mark.skipif( -- sys.platform.lower().startswith('freebsd'), -- reason='os.write to BLOCK indefinitely on FreeBSD in this case' -- ) -- def disabled_beyond_max_icanon(self): -- " a single BEL is sent when maximum bytes is reached. " -- # given, -- child = pexpect.spawn('bash', echo=self.echo, timeout=5) -- child.sendline('stty icanon imaxbel erase ^H') -- child.sendline('cat') -- send_bytes = self.max_input -- -- # exercise, -- child.sendline('_' * send_bytes) -- child.expect_exact('\a') -- -- # exercise, we must now backspace to send CR. -- child.sendcontrol('h') -- child.sendline() -- -- if os.environ.get('TRAVIS', None) == 'true': -- # Travis-CI has intermittent behavior here, possibly -- # because the master process is itself, a PTY? -- return -- -- # verify the length of (maximum - 1) received by cat(1), -- # which has written it back out, -- child.expect_exact('_' * (send_bytes - 1)) -- # and not a byte more. -- with self.assertRaises(pexpect.TIMEOUT): -- child.expect_exact('_', timeout=1) -- -- # cleanup, -- child.sendeof() # exit cat(1) -- child.sendline('exit 0') # exit bash(1) -- child.expect_exact(pexpect.EOF) -- assert not child.isalive() -- assert child.exitstatus == 0 -- -- @pytest.mark.skipif( -- sys.platform.lower().startswith('freebsd'), -- reason='os.write to BLOCK indefinitely on FreeBSD in this case' -- ) -- def disabled_max_no_icanon(self): -- " may exceed maximum input bytes if canonical mode is disabled. " -- # given, -- child = pexpect.spawn('bash', echo=self.echo, timeout=5) -- child.sendline('stty -icanon imaxbel') -- child.sendline('echo BEGIN; cat') -- send_bytes = self.max_input + 11 -- -- # exercise, -- child.sendline('_' * send_bytes) -- -- # fast forward beyond 'cat' command, as ^G can be found as part of -- # set-xterm-title sequence of $PROMPT_COMMAND or $PS1. -- child.expect_exact('BEGIN') -- -- if os.environ.get('TRAVIS', None) == 'true': -- # Travis-CI has intermittent behavior here, possibly -- # because the master process is itself, a PTY? -- return -- -- # BEL is *not* found, -- with self.assertRaises(pexpect.TIMEOUT): -- child.expect_exact('\a', timeout=1) -- -- # verify, all input is found in output, -- child.expect_exact('_' * send_bytes) -- -- # cleanup, -- child.sendcontrol('c') # exit cat(1) (eof wont work in -icanon) -- child.sendcontrol('c') -- child.sendline('exit 0') # exit bash(1) -- child.expect(pexpect.EOF) -- assert not child.isalive() -- assert child.exitstatus == 0 -diff --git a/tools/display-fpathconf.py b/tools/display-fpathconf.py -new file mode 100644 -index 0000000..d40cbae ---- /dev/null -+++ b/tools/display-fpathconf.py -@@ -0,0 +1,41 @@ -+#!/usr/bin/env python -+"""Displays os.fpathconf values related to terminals. """ -+from __future__ import print_function -+import sys -+import os -+ -+ -+def display_fpathconf(): -+ DISP_VALUES = ( -+ ('PC_MAX_CANON', ('Max no. of bytes in a ' -+ 'terminal canonical input line.')), -+ ('PC_MAX_INPUT', ('Max no. of bytes for which ' -+ 'space is available in a terminal input queue.')), -+ ('PC_PIPE_BUF', ('Max no. of bytes which will ' -+ 'be written atomically to a pipe.')), -+ ('PC_VDISABLE', 'Terminal character disabling value.') -+ ) -+ FMT = '{name:<13} {value:<5} {description}' -+ -+ # column header -+ print(FMT.format(name='name', value='value', description='description')) -+ print(FMT.format(name=('-' * 13), value=('-' * 5), description=('-' * 11))) -+ -+ fd = sys.stdin.fileno() -+ for name, description in DISP_VALUES: -+ key = os.pathconf_names.get(name, None) -+ if key is None: -+ value = 'UNDEF' -+ else: -+ try: -+ value = os.fpathconf(fd, name) -+ except OSError as err: -+ value = 'OSErrno {0.errno}'.format(err) -+ if name == 'PC_VDISABLE': -+ value = hex(value) -+ print(FMT.format(name=name, value=value, description=description)) -+ print() -+ -+ -+if __name__ == '__main__': -+ display_fpathconf() -diff --git a/tools/display-maxcanon.py b/tools/display-maxcanon.py -new file mode 100644 -index 0000000..cbd664f ---- /dev/null -+++ b/tools/display-maxcanon.py -@@ -0,0 +1,80 @@ -+#!/usr/bin/env python -+""" -+This tool uses pexpect to test expected Canonical mode length. -+ -+All systems use the value of MAX_CANON which can be found using -+fpathconf(3) value PC_MAX_CANON -- with the exception of Linux -+and FreeBSD. -+ -+Linux, though defining a value of 255, actually honors the value -+of 4096 from linux kernel include file tty.h definition -+N_TTY_BUF_SIZE. -+ -+Linux also does not honor IMAXBEL. termios(3) states, "Linux does not -+implement this bit, and acts as if it is always set." Although these -+tests ensure it is enabled, this is a non-op for Linux. -+ -+FreeBSD supports neither, and instead uses a fraction (1/5) of the tty -+speed which is always 9600. Therefor, the maximum limited input line -+length is 9600 / 5 = 1920. -+ -+These tests only ensure the correctness of the behavior described by -+the sendline() docstring -- the values listed there, and above should -+be equal to the output of the given OS described, but no promises! -+""" -+# std import -+from __future__ import print_function -+import sys -+import os -+ -+ -+def detect_maxcanon(): -+ import pexpect -+ bashrc = os.path.join( -+ # re-use pexpect/replwrap.py's bashrc file, -+ os.path.dirname(__file__), os.path.pardir, 'pexpect', 'bashrc.sh') -+ -+ child = pexpect.spawn('bash', ['--rcfile', bashrc], -+ echo=True, encoding='utf8', timeout=3) -+ -+ child.sendline(u'echo -n READY_; echo GO') -+ child.expect_exact(u'READY_GO') -+ -+ child.sendline(u'stty icanon imaxbel erase ^H; echo -n retval: $?') -+ child.expect_exact(u'retval: 0') -+ -+ child.sendline(u'echo -n GO_; echo AGAIN') -+ child.expect_exact(u'GO_AGAIN') -+ child.sendline(u'cat') -+ -+ child.delaybeforesend = 0 -+ -+ column, blocksize = 0, 64 -+ ch_marker = u'_' -+ -+ print('auto-detecting MAX_CANON: ', end='') -+ sys.stdout.flush() -+ -+ while True: -+ child.send(ch_marker * blocksize) -+ result = child.expect([ch_marker * blocksize, u'\a']) -+ if result == 0: -+ # entire block fit without emitting bel -+ column += blocksize -+ elif result == 1: -+ # an '\a' was emitted, count the number of ch_markers -+ # found since last blocksize, determining our MAX_CANON -+ column += child.before.count(ch_marker) -+ break -+ print(column) -+ -+if __name__ == '__main__': -+ try: -+ detect_maxcanon() -+ except ImportError: -+ # we'd like to use this with CI -- but until we integrate -+ # with tox, we can't determine a period in testing when -+ # the pexpect module has been installed -+ print('warning: pexpect not in module path, MAX_CANON ' -+ 'could not be determined by systems test.', -+ file=sys.stderr) --- -2.6.1 - diff --git a/python-pexpect.spec b/python-pexpect.spec index 2a83c49..5ed31c1 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -2,14 +2,14 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.1.0 -Release: 4%{?dist} +Version: 4.2.1 +Release: 1%{?dist} License: MIT -URL: https://github.com/%{modname}/%{modname} +URL: https://github.com/pexpect/pexpect Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz -BuildRequires: /usr/bin/man +BuildRequires: %{_bindir}/man BuildRequires: coreutils BuildArch: noarch @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Tue Feb 14 2017 Igor Gnatenko - 4.2.1-1 +- Update to 4.2.1 + * Sat Feb 11 2017 Fedora Release Engineering - 4.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 4e6a116..1f97ec3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -049f3c98f4b0b7426e6b5d8a01566786 pexpect-4.1.0.tar.gz +SHA512 (pexpect-4.2.1.tar.gz) = 30da69e18690f00522bd2514248b1d5613e96c2737435f6b47d30389f6acfc580511db2f89e34c8932f3af32cc61b55fb6dc19f02330c3e1e5be5417c22ebdd1 From 267857eb55e529d25c4354c550031173f129e336 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 11:16:27 +0000 Subject: [PATCH 22/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 5ed31c1..95d1dc8 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -3,7 +3,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.2.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 4.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Tue Feb 14 2017 Igor Gnatenko - 4.2.1-1 - Update to 4.2.1 From 089d7b0c56f338af4dfccba64a649fc80f8696ab Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 10 Nov 2017 10:38:27 +0100 Subject: [PATCH 23/34] Update to 4.3 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + python-pexpect.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0b006c5..ec775e4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ pexpect-2.3.tar.gz /pexpect-4.0.1.tar.gz /pexpect-4.1.0.tar.gz /pexpect-4.2.1.tar.gz +/pexpect-4.3.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index 95d1dc8..8c9c475 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -2,8 +2,8 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.2.1 -Release: 2%{?dist} +Version: 4.3 +Release: 1%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Fri Nov 10 2017 Igor Gnatenko - 4.3-1 +- Update to 4.3 + * Thu Jul 27 2017 Fedora Release Engineering - 4.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index 1f97ec3..3dc5145 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pexpect-4.2.1.tar.gz) = 30da69e18690f00522bd2514248b1d5613e96c2737435f6b47d30389f6acfc580511db2f89e34c8932f3af32cc61b55fb6dc19f02330c3e1e5be5417c22ebdd1 +SHA512 (pexpect-4.3.tar.gz) = ae3fa58732d680c9c2fe6d973b51e57718e815fb959eca9521e78ce38aa7b07ce29ceac94902f6cb8383132eea3b7ca1e4b53cebf4b4e20d23c720012722faa2 From 802adda513c5e3162bffa5bea74e8b0103dffabc Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 10 Nov 2017 10:42:11 +0100 Subject: [PATCH 24/34] remove proper async.py file Signed-off-by: Igor Gnatenko --- python-pexpect.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 8c9c475..97663d2 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -103,7 +103,7 @@ pushd python2 %py2_install rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests # Drop asyncio stuff from py2 - rm -f %{buildroot}%{python2_sitelib}/%{modname}/async.py + rm -f %{buildroot}%{python2_sitelib}/%{modname}/_async.py popd pushd python3 From 6532d0e4a91f55424e87ee3503d8098f9a6e6fe2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 22 Dec 2017 09:13:51 +0100 Subject: [PATCH 25/34] Update to 4.3.1 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + python-pexpect.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ec775e4..f79ca69 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ pexpect-2.3.tar.gz /pexpect-4.1.0.tar.gz /pexpect-4.2.1.tar.gz /pexpect-4.3.tar.gz +/pexpect-4.3.1.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index 97663d2..decb668 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -2,7 +2,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.3 +Version: 4.3.1 Release: 1%{?dist} License: MIT @@ -142,6 +142,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Fri Dec 22 2017 Igor Gnatenko - 4.3.1-1 +- Update to 4.3.1 + * Fri Nov 10 2017 Igor Gnatenko - 4.3-1 - Update to 4.3 diff --git a/sources b/sources index 3dc5145..9defe78 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pexpect-4.3.tar.gz) = ae3fa58732d680c9c2fe6d973b51e57718e815fb959eca9521e78ce38aa7b07ce29ceac94902f6cb8383132eea3b7ca1e4b53cebf4b4e20d23c720012722faa2 +SHA512 (pexpect-4.3.1.tar.gz) = efd8e1436235b2f3d1bbc018ca1779a34d5e91e84dd495259c77e08fedda425b19e81df0861b78bbd833c7fa2b7f62b41d96c20594ddfae12c33c152ca6ce061 From 01c16e6323e001970ffee6d54f69ffe0e83bd432 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 24 Dec 2017 13:42:53 +0100 Subject: [PATCH 26/34] disable tests Signed-off-by: Igor Gnatenko --- python-pexpect.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python-pexpect.spec b/python-pexpect.spec index decb668..d1fa2c2 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -1,3 +1,5 @@ +%bcond_with check + %global modname pexpect Name: python-%{modname} @@ -111,6 +113,7 @@ pushd python3 rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests popd +%if %{with check} %check export PYTHONIOENCODING=UTF-8 export LC_ALL="en_US.UTF-8" @@ -128,6 +131,7 @@ pushd python3 PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py py.test-3 --verbose popd +%endif %files -n python2-%{modname} %license python2/LICENSE From 81e2e12808f6c21038cbc24b5f1c4b7a2efd607f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 09:46:00 +0000 Subject: [PATCH 27/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index d1fa2c2..96eec42 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -5,7 +5,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.3.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -146,6 +146,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 4.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Fri Dec 22 2017 Igor Gnatenko - 4.3.1-1 - Update to 4.3.1 From 05e907de58d7a632a0ecf64cc5ad16d378ee77ad Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 12 Mar 2018 12:02:57 +0100 Subject: [PATCH 28/34] Update to 4.4.0 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + python-pexpect.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f79ca69..9aeaf92 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ pexpect-2.3.tar.gz /pexpect-4.2.1.tar.gz /pexpect-4.3.tar.gz /pexpect-4.3.1.tar.gz +/pexpect-4.4.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index 96eec42..9457aff 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -4,8 +4,8 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.3.1 -Release: 2%{?dist} +Version: 4.4.0 +Release: 1%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -146,6 +146,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Mon Mar 12 2018 Igor Gnatenko - 4.4.0-1 +- Update to 4.4.0 + * Fri Feb 09 2018 Fedora Release Engineering - 4.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index 9defe78..984ec87 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pexpect-4.3.1.tar.gz) = efd8e1436235b2f3d1bbc018ca1779a34d5e91e84dd495259c77e08fedda425b19e81df0861b78bbd833c7fa2b7f62b41d96c20594ddfae12c33c152ca6ce061 +SHA512 (pexpect-4.4.tar.gz) = 0da4e85cf6f1c686404d62143f6d159ff1a4769ce0f0d245b018262f4c261940d77f0220658e68b83d2d7131d02bd2468541f1ef2756893a8021e15ec2f72291 From fd0bcc49e292229a592fd7428e0a7c0e6fba0a5e Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 12 Mar 2018 12:05:00 +0100 Subject: [PATCH 29/34] commit spec changes Signed-off-by: Igor Gnatenko --- python-pexpect.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 9457aff..b8799ad 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -4,7 +4,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.4.0 +Version: 4.4 Release: 1%{?dist} License: MIT @@ -12,7 +12,6 @@ URL: https://github.com/pexpect/pexpect Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz BuildRequires: %{_bindir}/man -BuildRequires: coreutils BuildArch: noarch From b6b6d4fedf9dff716a3840496f2e2ff929afe089 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 23 May 2018 16:14:32 +0200 Subject: [PATCH 30/34] Update to 4.5.0 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + python-pexpect.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9aeaf92..c700f94 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ pexpect-2.3.tar.gz /pexpect-4.3.tar.gz /pexpect-4.3.1.tar.gz /pexpect-4.4.tar.gz +/pexpect-4.5.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index b8799ad..7874ee5 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -4,7 +4,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.4 +Version: 4.5.0 Release: 1%{?dist} License: MIT @@ -145,6 +145,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Wed May 23 2018 Igor Gnatenko - 4.5.0-1 +- Update to 4.5.0 + * Mon Mar 12 2018 Igor Gnatenko - 4.4.0-1 - Update to 4.4.0 diff --git a/sources b/sources index 984ec87..3f8b068 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pexpect-4.4.tar.gz) = 0da4e85cf6f1c686404d62143f6d159ff1a4769ce0f0d245b018262f4c261940d77f0220658e68b83d2d7131d02bd2468541f1ef2756893a8021e15ec2f72291 +SHA512 (pexpect-4.5.tar.gz) = db64dcded023696a8b447fa000a66600e402df0e62691dfad84a0073c0470a5c9b79c0266cc6f67d8b241d873e662963b37c577e9f47c4e1ec4702705baabbc3 From e5325b966a9b9bea6ad865387ea741d6af5b2e5b Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 23 May 2018 16:30:49 +0200 Subject: [PATCH 31/34] correct version tag Signed-off-by: Igor Gnatenko --- python-pexpect.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index 7874ee5..bf2a904 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -4,7 +4,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.5.0 +Version: 4.5 Release: 1%{?dist} License: MIT From c64b57e6016914979280ca8cade68c3b8b7beecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 16 Jun 2018 01:44:00 +0200 Subject: [PATCH 32/34] Rebuilt for Python 3.7 --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index bf2a904..f3469ac 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -5,7 +5,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.5 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -145,6 +145,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Fri Jun 15 2018 Miro Hrončok - 4.5-2 +- Rebuilt for Python 3.7 + * Wed May 23 2018 Igor Gnatenko - 4.5.0-1 - Update to 4.5.0 From bddaf943e30204dcc001b95ae50fb81aa7f47f4a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 01:23:03 +0000 Subject: [PATCH 33/34] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python-pexpect.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-pexpect.spec b/python-pexpect.spec index f3469ac..fceb729 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -5,7 +5,7 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module Version: 4.5 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -145,6 +145,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 4.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Fri Jun 15 2018 Miro Hrončok - 4.5-2 - Rebuilt for Python 3.7 From 79b043dc21ce672536745448a8eaa05cbeef09ad Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Wed, 25 Jul 2018 17:08:02 -0400 Subject: [PATCH 34/34] Update to 4.6 --- .gitignore | 1 + python-pexpect.spec | 7 +++++-- sources | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c700f94..15f3d05 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ pexpect-2.3.tar.gz /pexpect-4.3.1.tar.gz /pexpect-4.4.tar.gz /pexpect-4.5.tar.gz +/pexpect-4.6.tar.gz diff --git a/python-pexpect.spec b/python-pexpect.spec index fceb729..6b5ac0c 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -4,8 +4,8 @@ Name: python-%{modname} Summary: Unicode-aware Pure Python Expect-like module -Version: 4.5 -Release: 3%{?dist} +Version: 4.6 +Release: 1%{?dist} License: MIT URL: https://github.com/pexpect/pexpect @@ -145,6 +145,9 @@ popd %{python3_sitelib}/%{modname}-*.egg-info %changelog +* Wed Jul 25 2018 Dan Radez - 4.6-1 +- update to 4.6 + * Sat Jul 14 2018 Fedora Release Engineering - 4.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/sources b/sources index 3f8b068..a900509 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (pexpect-4.5.tar.gz) = db64dcded023696a8b447fa000a66600e402df0e62691dfad84a0073c0470a5c9b79c0266cc6f67d8b241d873e662963b37c577e9f47c4e1ec4702705baabbc3 +SHA512 (pexpect-4.6.tar.gz) = 20e6a91f159be1d4e0ef0a073247b3402e6193f3b167f1fd28238ef02ef605be055c1f19d40250b4989c637e75c30b693cf96a98ae81f3c7791b504476a467ab