io.BytesIO that preserves bytes after close
Project description
Python package bytesbufio
bytesbufio provides BytesBufferIO - an io.BytesIO implementation whose value can be accessed after it has been closed
Installation
pip install bytesbufio
Usage
import io
from bytesbufio import BytesBufferIO
bytesbuf = BytesBufferIO()
with io.TextIOWrapper(bytesbuf, encoding='utf-8') as textout:
textout.write("Hello world.")
text = bytesbuf.getvalue().decode('utf-8') # BytesIO would have raised an ValueError here
print(text)
Related
- Python Issue 22003 - BytesIO and shared bufferes
- Python Issue 23099 - value not available after close
License
Copyright (c) 2020 by Cornelius Buschka.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bytesbufio-1.0.2.tar.gz
(2.1 kB
view details)
Built Distribution
File details
Details for the file bytesbufio-1.0.2.tar.gz
.
File metadata
- Download URL: bytesbufio-1.0.2.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9920ddf2d60ac875b9130890482c129867bc92911a7717369cf50f0e92bde1 |
|
MD5 | 07fcef5c3c48ba4a7cbb2b42aa66d82a |
|
BLAKE2b-256 | 448428c7ced763fe9df95314a042402bdd979fafa06ba222da1f458f34a77db5 |
File details
Details for the file bytesbufio-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: bytesbufio-1.0.2-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dd082a88c9bee1afbd80a52c4dbe99033be8885c9a07cf0e579091e1193e87a |
|
MD5 | 7f22d19db92228fe9ff57ee70b990158 |
|
BLAKE2b-256 | b1442c0b7e4b8b1cfed62c17b81e14794772d1d0329882da1c53fb9b1ed1e051 |