diff --git a/python-autopage.changes b/python-autopage.changes index 1696a99..faead19 100644 --- a/python-autopage.changes +++ b/python-autopage.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 11 05:45:45 UTC 2023 - Steve Kowalik + +- Add patch support-python-311.patch: + * Support Python 3.11 changes. + ------------------------------------------------------------------- Mon Nov 21 12:23:06 UTC 2022 - Daniel Garcia diff --git a/python-autopage.spec b/python-autopage.spec index 554e0da..74ff9e7 100644 --- a/python-autopage.spec +++ b/python-autopage.spec @@ -1,7 +1,7 @@ # # spec file for package python-autopage # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,7 @@ Summary: A library to provide automatic paging for console output License: Apache-2.0 URL: https://github.com/zaneb/autopage Source: https://files.pythonhosted.org/packages/source/a/autopage/autopage-%{version}.tar.gz +Patch0: support-python-311.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} diff --git a/support-python-311.patch b/support-python-311.patch new file mode 100644 index 0000000..6d2dccc --- /dev/null +++ b/support-python-311.patch @@ -0,0 +1,41 @@ +Index: autopage-0.5.1/autopage/tests/test_autopage.py +=================================================================== +--- autopage-0.5.1.orig/autopage/tests/test_autopage.py ++++ autopage-0.5.1/autopage/tests/test_autopage.py +@@ -37,6 +37,9 @@ class PagedStreamTest(fixtures.TestWithF + popen = fixtures.MockPatch('subprocess.Popen') + self.useFixture(popen) + self.popen = popen.mock ++ self.encoding = 'UTF-8' ++ if sys.version_info >= (3, 11): ++ self.encoding = 'utf-8' + + def test_defaults(self) -> None: + class TestCommand(command.PagerCommand): +@@ -58,7 +61,7 @@ class PagedStreamTest(fixtures.TestWithF + env=get_env.return_value, + bufsize=-1, + universal_newlines=True, +- encoding='UTF-8', ++ encoding=self.encoding, + errors='strict', + stdin=subprocess.PIPE, + stdout=None) +@@ -84,7 +87,7 @@ class PagedStreamTest(fixtures.TestWithF + env=get_env.return_value, + bufsize=-1, + universal_newlines=True, +- encoding='UTF-8', ++ encoding=self.encoding, + errors='strict', + stdin=subprocess.PIPE, + stdout=None) +@@ -100,7 +103,7 @@ class PagedStreamTest(fixtures.TestWithF + env=get_env.return_value, + bufsize=-1, + universal_newlines=True, +- encoding='UTF-8', ++ encoding=self.encoding, + errors='strict', + stdin=subprocess.PIPE, + stdout=None)