Skip to main content

A context for writing a file which leaves it unchanged if an exception is thrown.

Example:

with safe_writer(filename) as fp:
    for line in source():
        print(line, file=fp)

# If there's an exception in the block, then `filename` is reverted
# to its initial state

Metadata

Release files for safe-writer 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for safe-writer 0.9.3
File Size Uploaded
safe_writer-0.9.3.tar.gz 2.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for safe-writer 0.9.3
File Interpreter ABI Platform
safe_writer-0.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / safe_writer-0.9.3.tar.gz

Download URL safe_writer-0.9.3.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d40cf16655571095426ef9c0e7b3ab3054b02d4adffbc575cc26ecbf266a9241
BLAKE2b-256 checksum
How to use checksums
6021365efc99762bf8182677119a849d19271de7b6ceaf2f8d3df8d8977923fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

Release files / safe_writer-0.9.3-py3-none-any.whl

Download URL safe_writer-0.9.3-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94fe9c425ff0afedb7cc23cffbc913b78b1f7a1af7ad23f87558a5728e4ba0b6
BLAKE2b-256 checksum
How to use checksums
ae20cc5da93aa0114a9ed91f3f2f647341d3208752bda62785f5dd08f977a6ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.9.3 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page