aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2022-09-24 22:19:52 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2022-09-24 22:19:52 +0300
commit3fe10018e5a45219fdacb4bac2f8d5739959824f (patch)
treecdd1b0fc58eaef47bcdb35a5e7f18fafbb009452
parentfileutils: remove deprecated `write_file` (diff)
downloadsnakeoil-3fe10018e5a45219fdacb4bac2f8d5739959824f.tar.gz
snakeoil-3fe10018e5a45219fdacb4bac2f8d5739959824f.tar.bz2
snakeoil-3fe10018e5a45219fdacb4bac2f8d5739959824f.zip
fileutils: remove unused `UnbufferedWriteHandle`
Not used anywhere, without tests. If needed, use `io.TextIOWrapper` with `write_through=True` argument. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/snakeoil/fileutils.py18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/snakeoil/fileutils.py b/src/snakeoil/fileutils.py
index 2f9da9a..cb60480 100644
--- a/src/snakeoil/fileutils.py
+++ b/src/snakeoil/fileutils.py
@@ -2,7 +2,7 @@
file related operations, mainly reading
"""
-__all__ = ("AtomicWriteFile", 'UnbufferedWriteHandle', 'touch')
+__all__ = ("AtomicWriteFile", 'touch')
types = [""] + list("_%s" % x for x in ("ascii", "utf8"))
__all__ += tuple("readfile%s" % x for x in types) + tuple("readlines%s" % x for x in types)
del types
@@ -55,22 +55,6 @@ def mmap_or_open_for_read(path):
raise
-class UnbufferedWriteHandle:
- """Class designed to work around py3k buffering issues
-
- see http://stackoverflow.com/questions/107705/python-output-buffering
- for background"""
-
- def __init__(self, stream):
- self.stream = stream
-
- def write(self, data):
- self.stream.write(data)
- self.stream.flush()
-
- __getattr__ = GetAttrProxy("stream")
-
-
class AtomicWriteFile_mixin:
"""File class that stores the changes in a tempfile.