pypy/module/_io/test/test_bufferedio.py::AppTestBufferedReader::()::test_bufio_write_through
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x00000001229c8138>
def test_bufio_write_through(self):
import _io as io
# Issue #21396: write_through=True doesn't force a flush()
# on the underlying binary buffered object.
flush_called, write_called = [], []
class BufferedWriter(io.BufferedWriter):
def flush(self, *args, **kwargs):
flush_called.append(True)
return super().flush(*args, **kwargs)
def write(self, *args, **kwargs):
write_called.append(True)
return super().write(*args, **kwargs)
rawio = io.BytesIO()
data = b"a"
bufio = BufferedWriter(rawio, len(data)*2)
> textio = io.TextIOWrapper(bufio, encoding='ascii',
write_through=True)
[/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/_io/test/test_bufferedio.py:380]:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
""" Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Each codec module must export the following interface:
* getregentry() -> codecs.CodecInfo object
The getregentry() API must return a CodecInfo object with encoder, decoder,
incrementalencoder, incrementaldecoder, streamwriter and streamreader
attributes which adhere to the Python Codec Interface Standard.
In addition, a module may optionally also define the following
APIs which are then used by the package's codec search function:
* getaliases() -> sequence of encoding name strings to use as aliases
Alias names returned by getaliases() must be normalized encoding
names as defined by normalize_encoding().
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
import sys
> from . import aliases
E (application-level) LookupError: unknown encoding: utf-8
../lib-python/3/encodings/__init__.py:33: LookupError
builder: own-macos-arm64 build #1354+
test: pypy/module/_io/test/test_bufferedio.py::AppTestBufferedReader::()::test_bufio_write_through