This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/allura.git
commit 6f75550763fec52583db4fb3b4feb054ac64845c Author: Dave Brondsema <dbronds...@slashdotmedia.com> AuthorDate: Wed Jan 10 11:41:06 2024 -0500 remove some old six.PY3 checks --- Allura/allura/config/middleware.py | 2 +- Allura/allura/lib/helpers.py | 2 +- Allura/allura/tests/unit/test_repo.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py index 75aa2a160..e481a1621 100644 --- a/Allura/allura/config/middleware.py +++ b/Allura/allura/config/middleware.py @@ -91,7 +91,7 @@ def make_app(global_conf: dict, **app_conf): class BeakerPickleSerializerWithLatin1(PickleSerializer): def loads(self, data_string): # need latin1 to decode py2 timestamps in py https://docs.python.org/3/library/pickle.html#pickle.Unpickler - return pickle.loads(data_string, **{'encoding': 'latin1'} if six.PY3 else {}) + return pickle.loads(data_string, encoding='latin1') def _make_core_app(root, global_conf: dict, **app_conf): diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py index c822d9e00..bc52a5638 100644 --- a/Allura/allura/lib/helpers.py +++ b/Allura/allura/lib/helpers.py @@ -239,7 +239,7 @@ def _attempt_encodings(s, encodings): for enc in encodings: try: if enc is None: - if six.PY3 and isinstance(s, bytes): + if isinstance(s, bytes): # special handling for bytes (avoid b'asdf' turning into "b'asfd'") return s.decode('utf-8') return str(s) # try default encoding, and handle other types like int, etc diff --git a/Allura/allura/tests/unit/test_repo.py b/Allura/allura/tests/unit/test_repo.py index 5f9756ea7..9aed47208 100644 --- a/Allura/allura/tests/unit/test_repo.py +++ b/Allura/allura/tests/unit/test_repo.py @@ -277,8 +277,7 @@ class TestZipDir(unittest.TestCase): emsg = str(cm.exception) self.assertIn( "Command: " + - ("['/bin/zip', '-y', '-q', '-r', '/fake/zip/file.tmp', b'repo'] " if six.PY3 else - "[u'/bin/zip', u'-y', u'-q', u'-r', u'/fake/zip/file.tmp', 'repo'] ") + + "['/bin/zip', '-y', '-q', '-r', '/fake/zip/file.tmp', b'repo'] " + "returned non-zero exit code 1", emsg) self.assertTrue("STDOUT: 1" in emsg) self.assertTrue("STDERR: 2" in emsg)