Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-autopage for openSUSE:Factory 
checked in at 2023-11-13 22:18:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-autopage (Old)
 and      /work/SRC/openSUSE:Factory/.python-autopage.new.17445 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-autopage"

Mon Nov 13 22:18:07 2023 rev:7 rq:1124975 version:0.5.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-autopage/python-autopage.changes  
2023-01-11 17:14:30.511636280 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-autopage.new.17445/python-autopage.changes   
    2023-11-13 22:20:43.991198592 +0100
@@ -1,0 +2,17 @@
+Fri Nov 10 13:14:47 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.5.2:
+  * Always return an integer error code from exit_code()
+  * Fix line buffering detection for TTYs on Illumos/Solaris
+  * Numerous improvements to the integration tests:
+    - Work correctly with less v633
+    - Fix flaky tests
+    - Improve behaviour and debugging when tests fail
+    - Allow test runners to capture stdout of all child processes
+  * Update test dependencies to account for recent releases of
+    fixtures
+  * Test using a more recent version of mypy
+  * Run tests on Python 3.11 and 3.12
+  main
+
+-------------------------------------------------------------------

Old:
----
  autopage-0.5.1.tar.gz

New:
----
  autopage-0.5.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-autopage.spec ++++++
--- /var/tmp/diff_new_pack.ohYkNX/_old  2023-11-13 22:20:45.351248667 +0100
+++ /var/tmp/diff_new_pack.ohYkNX/_new  2023-11-13 22:20:45.367249256 +0100
@@ -16,9 +16,8 @@
 #
 
 
-%global skip_python2 1
 Name:           python-autopage
-Version:        0.5.1
+Version:        0.5.2
 Release:        0
 Summary:        A library to provide automatic paging for console output
 License:        Apache-2.0

++++++ autopage-0.5.1.tar.gz -> autopage-0.5.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/.package/lib/python3.10/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/.package/lib/python3.10/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/.package/lib/python3.10/site-packages/pip/py.typed  
2022-05-09 17:11:49.000000000 +0200
+++ new/autopage-0.5.2/.tox/.package/lib/python3.10/site-packages/pip/py.typed  
1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-pip is a command line program. While it is implemented in Python, and so is
-available for import, you must not use pip's internal APIs in this way. Typing
-information is provided as a convenience only and is not a guarantee. Expect
-unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/.package/lib/python3.11/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/.package/lib/python3.11/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/.package/lib/python3.11/site-packages/pip/py.typed  
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/.package/lib/python3.11/site-packages/pip/py.typed  
2023-05-25 02:30:05.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed      
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed      
2023-10-13 00:23:23.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/mypy/lib/python3.11/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/mypy/lib/python3.11/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/mypy/lib/python3.11/site-packages/pip/py.typed      
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/mypy/lib/python3.11/site-packages/pip/py.typed      
2023-10-13 06:00:58.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed 
new/autopage-0.5.2/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed
--- old/autopage-0.5.1/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed   
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed   
2023-05-25 02:30:12.000000000 +0200
@@ -0,0 +1 @@
+# Marker file for PEP 561.  The mypy package uses inline types.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/mypy/lib64/python3.9/site-packages/mypy/py.typed 
new/autopage-0.5.2/.tox/mypy/lib64/python3.9/site-packages/mypy/py.typed
--- old/autopage-0.5.1/.tox/mypy/lib64/python3.9/site-packages/mypy/py.typed    
2022-01-21 15:26:29.000000000 +0100
+++ new/autopage-0.5.2/.tox/mypy/lib64/python3.9/site-packages/mypy/py.typed    
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-# Marker file for PEP 561.  The mypy package uses inline types.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/pep8/lib/python3.11/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/pep8/lib/python3.11/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/pep8/lib/python3.11/site-packages/pip/py.typed      
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/pep8/lib/python3.11/site-packages/pip/py.typed      
2023-10-13 06:00:54.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py311/lib/python3.11/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/py311/lib/python3.11/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/py311/lib/python3.11/site-packages/pip/py.typed     
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py311/lib/python3.11/site-packages/pip/py.typed     
2023-10-13 00:23:22.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py312/lib/python3.12/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/py312/lib/python3.12/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/py312/lib/python3.12/site-packages/pip/py.typed     
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py312/lib/python3.12/site-packages/pip/py.typed     
2023-10-13 10:15:06.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py36/lib/python3.6/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/py36/lib/python3.6/site-packages/pip/py.typed       
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/pip/py.typed       
2023-10-13 06:02:29.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py36/lib/python3.6/site-packages/tomli/py.typed 
new/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/tomli/py.typed
--- old/autopage-0.5.1/.tox/py36/lib/python3.6/site-packages/tomli/py.typed     
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/tomli/py.typed     
2023-05-25 02:30:29.000000000 +0200
@@ -0,0 +1 @@
+# Marker file for PEP 561
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py37/lib/python3.7/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/py37/lib/python3.7/site-packages/pip/py.typed       
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/pip/py.typed       
2023-10-13 06:02:35.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py37/lib/python3.7/site-packages/tomli/py.typed 
new/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/tomli/py.typed
--- old/autopage-0.5.1/.tox/py37/lib/python3.7/site-packages/tomli/py.typed     
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/tomli/py.typed     
2023-05-25 02:30:38.000000000 +0200
@@ -0,0 +1 @@
+# Marker file for PEP 561
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py38/lib/python3.8/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/py38/lib/python3.8/site-packages/pip/py.typed       
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/pip/py.typed       
2023-10-13 06:02:41.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/py38/lib/python3.8/site-packages/tomli/py.typed 
new/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/tomli/py.typed
--- old/autopage-0.5.1/.tox/py38/lib/python3.8/site-packages/tomli/py.typed     
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/tomli/py.typed     
2023-05-25 02:30:45.000000000 +0200
@@ -0,0 +1 @@
+# Marker file for PEP 561
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed 
new/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed
--- old/autopage-0.5.1/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed        
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed        
2023-10-13 06:01:00.000000000 +0200
@@ -0,0 +1,4 @@
+pip is a command line program. While it is implemented in Python, and so is
+available for import, you must not use pip's internal APIs in this way. Typing
+information is provided as a convenience only and is not a guarantee. Expect
+unannounced changes to the API and types in releases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autopage-0.5.1/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed 
new/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed
--- old/autopage-0.5.1/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed      
1970-01-01 01:00:00.000000000 +0100
+++ new/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed      
2023-05-25 02:30:18.000000000 +0200
@@ -0,0 +1 @@
+# Marker file for PEP 561
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/PKG-INFO new/autopage-0.5.2/PKG-INFO
--- old/autopage-0.5.1/PKG-INFO 2022-05-27 16:46:58.188008300 +0200
+++ new/autopage-0.5.2/PKG-INFO 2023-10-16 11:19:58.986908000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: autopage
-Version: 0.5.1
+Version: 0.5.2
 Summary: A library to provide automatic paging for console output
 Home-page: https://github.com/zaneb/autopage
 Author: Zane Bitter
@@ -14,6 +14,8 @@
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
 Classifier: Operating System :: POSIX
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
@@ -128,7 +130,7 @@
 user to override the pager command by setting the `PAGER` environment variable.
 To disable this behaviour, pass
 `pager_command=autopage.command.PlatformPager()` to use the default pager for
-the current platform, or pass a specific pager from `autopage.commands`. The
+the current platform, or pass a specific pager from `autopage.command`. The
 default pager command is `less` on most platforms. On AIX the default pager
 command is `more`, and on Windows `more.com`.
 
@@ -165,9 +167,9 @@
 import sys
 import autopage
 
-with autopage.AutoPager(line_buffering=line_buffer_from_input()) as out:
+with autopage.AutoPager(line_buffering=autopage.line_buffer_from_input()) as o:
     for l in sys.stdin:
-        out.write(l)
+        o.write(l)
 ```
 
 ## Terminal reset
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/README.md new/autopage-0.5.2/README.md
--- old/autopage-0.5.1/README.md        2022-01-21 19:30:50.000000000 +0100
+++ new/autopage-0.5.2/README.md        2023-05-25 01:25:05.000000000 +0200
@@ -101,7 +101,7 @@
 user to override the pager command by setting the `PAGER` environment variable.
 To disable this behaviour, pass
 `pager_command=autopage.command.PlatformPager()` to use the default pager for
-the current platform, or pass a specific pager from `autopage.commands`. The
+the current platform, or pass a specific pager from `autopage.command`. The
 default pager command is `less` on most platforms. On AIX the default pager
 command is `more`, and on Windows `more.com`.
 
@@ -138,9 +138,9 @@
 import sys
 import autopage
 
-with autopage.AutoPager(line_buffering=line_buffer_from_input()) as out:
+with autopage.AutoPager(line_buffering=autopage.line_buffer_from_input()) as o:
     for l in sys.stdin:
-        out.write(l)
+        o.write(l)
 ```
 
 ## Terminal reset
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/autopage/__init__.py 
new/autopage-0.5.2/autopage/__init__.py
--- old/autopage-0.5.1/autopage/__init__.py     2022-01-21 15:51:20.000000000 
+0100
+++ new/autopage-0.5.2/autopage/__init__.py     2023-10-16 11:01:59.000000000 
+0200
@@ -224,7 +224,7 @@
                 return True
             elif isinstance(exc, KeyboardInterrupt):
                 self._exit_code = _signal_exit_code(signal.SIGINT)
-            elif isinstance(exc, SystemExit):
+            elif isinstance(exc, SystemExit) and isinstance(exc.code, int):
                 self._exit_code = exc.code
             else:
                 self._exit_code = 1
@@ -263,7 +263,8 @@
     """
     if input_stream is None:
         input_stream = sys.stdin
-    return not input_stream.seekable()
+    # On Illumos, TTYs claim to be seekable so don't believe them
+    return not (input_stream.seekable() and not input_stream.isatty())
 
 
 def _signal_exit_code(signum: signal.Signals) -> int:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/autopage/tests/isolation.py 
new/autopage-0.5.2/autopage/tests/isolation.py
--- old/autopage-0.5.1/autopage/tests/isolation.py      2022-05-09 
17:55:16.000000000 +0200
+++ new/autopage-0.5.2/autopage/tests/isolation.py      2023-10-13 
13:50:11.000000000 +0200
@@ -26,7 +26,7 @@
 import traceback
 
 import types
-from typing import Optional, Generator
+from typing import Optional, Generator, Tuple
 import typing
 
 
@@ -56,15 +56,20 @@
 
         self._exit_code: Optional[int] = None
 
+        self._raw_lines: typing.List[str] = []
+        self._lines: typing.List[str] = []
+
     def interrupt(self) -> None:
         self.write(b'\x03')
-        time.sleep(0.001)
 
     def write(self, data: bytes) -> None:
         os.write(self._ptm_fd, data)
+        time.sleep(0.001)
 
     def readline(self) -> str:
-        return self._tty.readline()
+        line = self._tty.readline()
+        self._raw_lines.append(line)
+        return line
 
     def error_output(self) -> str:
         if self._stderr_fifo_fd is None:
@@ -103,6 +108,13 @@
         assert self._exit_code is not None
         return self._exit_code
 
+    def record_output(self, line: str) -> None:
+        self._lines.append(line)
+
+    def recorded_output(self) -> typing.Tuple[typing.List[str],
+                                              typing.List[str]]:
+        return self._raw_lines[:], self._lines[:]
+
 
 class PagerControl:
     _page_end = None
@@ -116,6 +128,25 @@
 
     def _iter_lines(self) -> Generator[typing.Union[str, None],
                                        None, None]:
+        def get_content(segment: str) -> Tuple[bool,
+                                               typing.Union[str, None]]:
+            if not segment:
+                return False, ''
+            if segment == '\x1b[1m~\x1b[0m\n':
+                # Ignore lines that are filling blank vertical space with
+                # '~' after hitting Ctrl-C when the screen is not full
+                return False, ''
+            visible = self._ctrl_chars.sub('', segment)
+            if ((visible.rstrip() == ':' or '(END)' in visible
+                    or 'Waiting for data...' in visible)
+                    and segment.replace('\x1b[m', '') != visible):
+                return True, self._page_end
+            elif visible.rstrip() or segment == visible:
+                self._total_lines += 1
+                self.env.record_output(visible)
+                return True, visible
+            return False, ''
+
         while True:
             line = '\x1b[?'
             while line.lstrip(' q').startswith('\x1b[?'):
@@ -123,18 +154,15 @@
                 line = (rawline.replace('\x07', '')     # Ignore bell
                                .replace('\x1b[m', ''))  # Ignore style reset
             before, reset, after = line.partition('\x1b[2J')
-            for segment in filter(bool, (before, after)):
-                if segment == '\x1b[1m~\x1b[0m\n':
-                    # Ignore lines that are filling blank vertical space with
-                    # '~' after hitting Ctrl-C when the screen is not full
-                    continue
-                visible = self._ctrl_chars.sub('', segment)
-                if ((visible.rstrip() == ':' or '(END)' in visible)
-                        and segment.replace('\x1b[m', '') != visible):
-                    yield self._page_end
-                elif visible != '\n' or segment == visible:
-                    self._total_lines += 1
-                    yield visible
+
+            valid, content = get_content(before)
+            if valid:
+                yield content
+            if reset and not (valid and (content is self._page_end)):
+                yield self._page_end
+            valid, content = get_content(after)
+            if valid:
+                yield content
 
     def read_lines(self, count: int) -> typing.Iterator[str]:
         return itertools.islice((line for line in self._lines
@@ -190,6 +218,11 @@
     pass
 
 
+class TimeoutException(Exception):
+    def __init__(self, pid: Optional[int]):
+        super(Exception, self).__init__(f'Test process {pid} timed out')
+
+
 @contextlib.contextmanager
 def isolate(child_function: typing.Callable[[], int],
             stdin_pipe: bool = False,
@@ -204,10 +237,12 @@
                 'stderr' if stderr_pipe else None) as fifo_paths:
         result_r, result_w = os.pipe()
         env_pid, tty = pty.fork()
-        if env_pid == 0:
+        if env_pid == pty.CHILD:
             try:
                 os.close(result_r)
-                pts = os.ttyname(sys.stdout.fileno())
+                # Get ttyname from original stdout, even if test runner has
+                # replaced stdout with another file
+                pts = os.ttyname(pty.STDOUT_FILENO)
 
                 ctx = multiprocessing.get_context('spawn')
                 p = ctx.Process(target=_run_test, args=(child_function, pts,
@@ -215,7 +250,7 @@
                 p.start()
 
                 def handle_terminate(signum: int,
-                                     frame: types.FrameType) -> None:
+                                     frame: Optional[types.FrameType]) -> None:
                     if p.is_alive():
                         p.terminate()
 
@@ -224,14 +259,18 @@
                 signal.signal(signal.SIGINT, signal.SIG_IGN)
 
                 p.join(2)  # Wait at most 2s
+                if p.exitcode is None:
+                    raise TimeoutException(p.pid)
             except BaseException:
-                with os.fdopen(result_w, 'w') as result_writer:
-                    traceback.print_exc(file=result_writer)
-                # Prevent blocking in parent process by opening our end of all
-                # FIFOs.
-                for path, write in zip(fifo_paths, [True, False, False]):
-                    _open_fifo(path, write)
-                os._exit(1)
+                try:
+                    with os.fdopen(result_w, 'w') as result_writer:
+                        traceback.print_exc(file=result_writer)
+                finally:
+                    # Prevent blocking in parent process by opening our end of
+                    # all FIFOs.
+                    for path, write in zip(fifo_paths, [False, True, True]):
+                        _open_fifo(path, write)
+                    os._exit(1)
             with os.fdopen(result_w, 'w') as result_writer:
                 result_writer.write(f'{p.exitcode}\n')
 
@@ -243,20 +282,29 @@
             env = IsolationEnvironment(env_pid, tty, *fifo_paths)
             time.sleep(0.01)
             try:
-                yield env
-            finally:
-                def get_return_code() -> int:
-                    with os.fdopen(result_r) as result_reader:
-                        result = result_reader.readline().rstrip()
-                        try:
-                            return int(result)
-                        except ValueError:
-                            pass
-                        trace = result_reader.read()
-                        raise TestProcessNotComplete('\n'.join([result,
-                                                                trace]))
-
-                env.close(get_return_code)
+                try:
+                    yield env
+                finally:
+                    def get_return_code() -> int:
+                        with os.fdopen(result_r) as result_reader:
+                            result = result_reader.readline().rstrip()
+                            try:
+                                return int(result)
+                            except ValueError:
+                                pass
+                            trace = result_reader.read()
+                            raise TestProcessNotComplete('\n'.join([result,
+                                                                    trace]))
+
+                    env.close(get_return_code)
+            except Exception:
+                raw, processed = env.recorded_output()
+                if raw:
+                    print(f'Raw output: {repr(raw)}', file=sys.stderr)
+                if processed:
+                    print(f'Recorded output: {repr(processed)}',
+                          file=sys.stderr)
+                raise
 
 
 def _run_test(test_function: typing.Callable[[], int],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/autopage.egg-info/PKG-INFO 
new/autopage-0.5.2/autopage.egg-info/PKG-INFO
--- old/autopage-0.5.1/autopage.egg-info/PKG-INFO       2022-05-27 
16:46:57.000000000 +0200
+++ new/autopage-0.5.2/autopage.egg-info/PKG-INFO       2023-10-16 
11:19:58.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: autopage
-Version: 0.5.1
+Version: 0.5.2
 Summary: A library to provide automatic paging for console output
 Home-page: https://github.com/zaneb/autopage
 Author: Zane Bitter
@@ -14,6 +14,8 @@
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
 Classifier: Operating System :: POSIX
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
@@ -128,7 +130,7 @@
 user to override the pager command by setting the `PAGER` environment variable.
 To disable this behaviour, pass
 `pager_command=autopage.command.PlatformPager()` to use the default pager for
-the current platform, or pass a specific pager from `autopage.commands`. The
+the current platform, or pass a specific pager from `autopage.command`. The
 default pager command is `less` on most platforms. On AIX the default pager
 command is `more`, and on Windows `more.com`.
 
@@ -165,9 +167,9 @@
 import sys
 import autopage
 
-with autopage.AutoPager(line_buffering=line_buffer_from_input()) as out:
+with autopage.AutoPager(line_buffering=autopage.line_buffer_from_input()) as o:
     for l in sys.stdin:
-        out.write(l)
+        o.write(l)
 ```
 
 ## Terminal reset
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/autopage.egg-info/SOURCES.txt 
new/autopage-0.5.2/autopage.egg-info/SOURCES.txt
--- old/autopage-0.5.1/autopage.egg-info/SOURCES.txt    2022-05-27 
16:46:58.000000000 +0200
+++ new/autopage-0.5.2/autopage.egg-info/SOURCES.txt    2023-10-16 
11:19:58.000000000 +0200
@@ -4,22 +4,34 @@
 pyproject.toml
 setup.cfg
 tox.ini
-.tox/.package/lib/python3.10/site-packages/pip/py.typed
-.tox/mypy/lib/python3.9/site-packages/autopage/py.typed
-.tox/mypy/lib64/python3.9/site-packages/mypy/py.typed
-.tox/pep8/lib/python3.9/site-packages/autopage/py.typed
+.tox/.package/lib/python3.11/site-packages/pip/py.typed
+.tox/.pkg/lib/python3.11/site-packages/pip/py.typed
+.tox/mypy/lib/python3.11/site-packages/autopage/py.typed
+.tox/mypy/lib/python3.11/site-packages/pip/py.typed
+.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed
+.tox/pep8/lib/python3.11/site-packages/autopage/py.typed
+.tox/pep8/lib/python3.11/site-packages/pip/py.typed
 .tox/py310/lib/python3.10/site-packages/_pytest/py.typed
-.tox/py310/lib/python3.10/site-packages/attr/py.typed
-.tox/py310/lib/python3.10/site-packages/attrs/py.typed
 .tox/py310/lib/python3.10/site-packages/autopage/py.typed
+.tox/py310/lib/python3.10/site-packages/exceptiongroup/py.typed
 .tox/py310/lib/python3.10/site-packages/iniconfig/py.typed
 .tox/py310/lib/python3.10/site-packages/packaging/py.typed
 .tox/py310/lib/python3.10/site-packages/pip/py.typed
-.tox/py310/lib/python3.10/site-packages/py/py.typed
-.tox/py310/lib/python3.10/site-packages/py/_vendored_packages/iniconfig/py.typed
-.tox/py310/lib/python3.10/site-packages/pyparsing/py.typed
 .tox/py310/lib/python3.10/site-packages/pytest/py.typed
 .tox/py310/lib/python3.10/site-packages/tomli/py.typed
+.tox/py311/lib/python3.11/site-packages/_pytest/py.typed
+.tox/py311/lib/python3.11/site-packages/autopage/py.typed
+.tox/py311/lib/python3.11/site-packages/iniconfig/py.typed
+.tox/py311/lib/python3.11/site-packages/packaging/py.typed
+.tox/py311/lib/python3.11/site-packages/pip/py.typed
+.tox/py311/lib/python3.11/site-packages/pytest/py.typed
+.tox/py312/lib/python3.12/site-packages/_pytest/py.typed
+.tox/py312/lib/python3.12/site-packages/autopage/py.typed
+.tox/py312/lib/python3.12/site-packages/iniconfig/py.typed
+.tox/py312/lib/python3.12/site-packages/packaging/py.typed
+.tox/py312/lib/python3.12/site-packages/pip/py.typed
+.tox/py312/lib/python3.12/site-packages/pluggy/py.typed
+.tox/py312/lib/python3.12/site-packages/pytest/py.typed
 .tox/py36/lib/python3.6/site-packages/_pytest/py.typed
 .tox/py36/lib/python3.6/site-packages/attr/py.typed
 .tox/py36/lib/python3.6/site-packages/attrs/py.typed
@@ -27,54 +39,49 @@
 .tox/py36/lib/python3.6/site-packages/importlib_metadata/py.typed
 .tox/py36/lib/python3.6/site-packages/iniconfig/py.typed
 .tox/py36/lib/python3.6/site-packages/packaging/py.typed
+.tox/py36/lib/python3.6/site-packages/pip/py.typed
 .tox/py36/lib/python3.6/site-packages/py/py.typed
 .tox/py36/lib/python3.6/site-packages/py/_vendored_packages/iniconfig/py.typed
+.tox/py36/lib/python3.6/site-packages/pyparsing/py.typed
 .tox/py36/lib/python3.6/site-packages/pytest/py.typed
+.tox/py36/lib/python3.6/site-packages/tomli/py.typed
 .tox/py37/lib/python3.7/site-packages/_pytest/py.typed
-.tox/py37/lib/python3.7/site-packages/attr/py.typed
-.tox/py37/lib/python3.7/site-packages/attrs/py.typed
 .tox/py37/lib/python3.7/site-packages/autopage/py.typed
+.tox/py37/lib/python3.7/site-packages/exceptiongroup/py.typed
 .tox/py37/lib/python3.7/site-packages/importlib_metadata/py.typed
 .tox/py37/lib/python3.7/site-packages/iniconfig/py.typed
 .tox/py37/lib/python3.7/site-packages/packaging/py.typed
-.tox/py37/lib/python3.7/site-packages/py/py.typed
-.tox/py37/lib/python3.7/site-packages/py/_vendored_packages/iniconfig/py.typed
+.tox/py37/lib/python3.7/site-packages/pip/py.typed
 .tox/py37/lib/python3.7/site-packages/pytest/py.typed
+.tox/py37/lib/python3.7/site-packages/tomli/py.typed
 .tox/py38/lib/python3.8/site-packages/_pytest/py.typed
-.tox/py38/lib/python3.8/site-packages/attr/py.typed
-.tox/py38/lib/python3.8/site-packages/attrs/py.typed
 .tox/py38/lib/python3.8/site-packages/autopage/py.typed
+.tox/py38/lib/python3.8/site-packages/exceptiongroup/py.typed
 .tox/py38/lib/python3.8/site-packages/iniconfig/py.typed
 .tox/py38/lib/python3.8/site-packages/packaging/py.typed
-.tox/py38/lib/python3.8/site-packages/py/py.typed
-.tox/py38/lib/python3.8/site-packages/py/_vendored_packages/iniconfig/py.typed
+.tox/py38/lib/python3.8/site-packages/pip/py.typed
 .tox/py38/lib/python3.8/site-packages/pytest/py.typed
+.tox/py38/lib/python3.8/site-packages/tomli/py.typed
 .tox/py39/lib/python3.9/site-packages/_pytest/py.typed
-.tox/py39/lib/python3.9/site-packages/attr/py.typed
-.tox/py39/lib/python3.9/site-packages/attrs/py.typed
 .tox/py39/lib/python3.9/site-packages/autopage/py.typed
+.tox/py39/lib/python3.9/site-packages/exceptiongroup/py.typed
 .tox/py39/lib/python3.9/site-packages/iniconfig/py.typed
 .tox/py39/lib/python3.9/site-packages/packaging/py.typed
 .tox/py39/lib/python3.9/site-packages/pip/py.typed
-.tox/py39/lib/python3.9/site-packages/py/py.typed
-.tox/py39/lib/python3.9/site-packages/py/_vendored_packages/iniconfig/py.typed
-.tox/py39/lib/python3.9/site-packages/pyparsing/py.typed
 .tox/py39/lib/python3.9/site-packages/pytest/py.typed
 .tox/py39/lib/python3.9/site-packages/tomli/py.typed
 .tox/pypy/site-packages/attr/py.typed
 .tox/pypy/site-packages/packaging/py.typed
 .tox/pypy/site-packages/py/py.typed
 .tox/pypy/site-packages/py/_vendored_packages/iniconfig/py.typed
-.tox/pypy3/site-packages/_pytest/py.typed
-.tox/pypy3/site-packages/attr/py.typed
-.tox/pypy3/site-packages/attrs/py.typed
-.tox/pypy3/site-packages/autopage/py.typed
-.tox/pypy3/site-packages/importlib_metadata/py.typed
-.tox/pypy3/site-packages/iniconfig/py.typed
-.tox/pypy3/site-packages/packaging/py.typed
-.tox/pypy3/site-packages/py/py.typed
-.tox/pypy3/site-packages/py/_vendored_packages/iniconfig/py.typed
-.tox/pypy3/site-packages/pytest/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/_pytest/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/autopage/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/exceptiongroup/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/iniconfig/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/packaging/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/pytest/py.typed
+.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed
 autopage/__init__.py
 autopage/argparse.py
 autopage/command.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/setup.cfg new/autopage-0.5.2/setup.cfg
--- old/autopage-0.5.1/setup.cfg        2022-05-27 16:46:58.189008500 +0200
+++ new/autopage-0.5.2/setup.cfg        2023-10-16 11:19:58.986908000 +0200
@@ -1,6 +1,6 @@
 [metadata]
 name = autopage
-version = 0.5.1
+version = 0.5.2
 author = Zane Bitter
 author_email = zbit...@redhat.com
 description = A library to provide automatic paging for console output
@@ -17,6 +17,8 @@
        Programming Language :: Python :: 3.8
        Programming Language :: Python :: 3.9
        Programming Language :: Python :: 3.10
+       Programming Language :: Python :: 3.11
+       Programming Language :: Python :: 3.12
        Operating System :: POSIX
        Environment :: Console
        Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopage-0.5.1/tox.ini new/autopage-0.5.2/tox.ini
--- old/autopage-0.5.1/tox.ini  2021-11-21 01:05:34.000000000 +0100
+++ new/autopage-0.5.2/tox.ini  2023-06-16 03:21:27.000000000 +0200
@@ -1,13 +1,16 @@
 [tox]
-envlist = pep8,mypy,pypy3,py36,py37,py38,py39,py310
+envlist = pep8,mypy,pypy3,py36,py37,py38,py39,py310,py311,py312
 isolated_build = true
 
 [testenv]
 deps =
     pytest
     fixtures
+    fixtures[streams]
+    pip>=19;python_version<'3.7'
+    testtools;python_version<'3.7'
 commands =
-    pytest -s
+    pytest
 
 [testenv:pep8]
 deps = flake8
@@ -15,6 +18,6 @@
     flake8 autopage
 
 [testenv:mypy]
-deps = mypy>=0.800,<0.900
+deps = mypy>=0.900,<1.3.0
 commands =
     mypy -p autopage

Reply via email to