commit:     eecff359c03191e149a9b281dc7a0e0ab39bf666
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Nov 28 20:46:19 2025 +0000
Commit:     Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Fri Nov 28 21:46:40 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=eecff359

feat!: drop readlines_bytes, a hold over from py2k -> py3k

These existed since the underlying c extension was drastically
faster than what python provided.  I wouldn't be shocked
if that's still true, but the extensions got thrown out a long
while back, and this isn't worth the pain.

The rest of them will get addressed as code is updated.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

 src/snakeoil/fileutils.py |  1 -
 tests/test_fileutils.py   | 17 +----------------
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/src/snakeoil/fileutils.py b/src/snakeoil/fileutils.py
index fdd0f23..07746d8 100644
--- a/src/snakeoil/fileutils.py
+++ b/src/snakeoil/fileutils.py
@@ -166,6 +166,5 @@ _mk_readlines = partial(
 )
 
 readlines_ascii = _mk_readlines("ascii", "r", encoding="ascii")
-readlines_bytes = _mk_readlines("bytes", "rb")
 readlines_utf8 = _mk_readlines("utf8", "r", encoding="utf8")
 readlines = readlines_utf8

diff --git a/tests/test_fileutils.py b/tests/test_fileutils.py
index 0db7ce2..999c7ad 100644
--- a/tests/test_fileutils.py
+++ b/tests/test_fileutils.py
@@ -172,21 +172,6 @@ class Test_readfile_utf8(Test_readfile):
     default_encoding = "utf8"
 
 
-class Test_readfile_bytes(Test_readfile):
-    func = staticmethod(fileutils.readfile_bytes)
-    default_encoding = None
-    test_cases = list(
-        map(
-            currying.post_curry(Test_readfile.convert_data, "ascii"),
-            Test_readfile.test_cases,
-        )
-    )
-    test_cases.append("\ua000fa".encode("utf8"))
-    none_on_missing_ret_data = Test_readfile.convert_data(
-        Test_readfile.none_on_missing_ret_data, "ascii"
-    )
-
-
 class readlines_mixin:
     def assertFunc(self, path, expected):
         expected = tuple(expected.split())
@@ -258,7 +243,7 @@ def mk_readlines_test(scope, mode):
     scope["Test_%s" % func_name] = kls
 
 
-for case in ("ascii", "bytes", "utf8"):
+for case in ("ascii", "utf8"):
     name = "readlines_%s" % case
     mk_readlines_test(locals(), case)
 

Reply via email to