Skip to main content

encodingcontext — A bad idea about the default encoding

Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.

—Zen of Python

This small module implements a bad idea: making default encoding explicitly scoped:

>>> with encoding_context('euc-kr'):
...     str(u'\ud55c\uae00')
...
'\xc7\xd1\xb1\xdb'

Of course it has several shortcomings, and the most critical one is: using it within thread, threading, greenlet, tasklet, etc probably breaks its scoping. If Python had dynamic scoping and default encoding was defined as dynamically scoped variable, we might have more convenient way to code between Unicode–byte strings.

Metadata

Release files for encodingcontext 0.9.0

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

Source distribution (sdist)

Source distribution for encodingcontext 0.9.0
File Size Uploaded Provenance Actions
encodingcontext-0.9.0.tar.gz 1.7 kB Without provenance Details for encodingcontext-0.9.0.tar.gz

Release files / encodingcontext-0.9.0.tar.gz

Download URL encodingcontext-0.9.0.tar.gz
Size 1.7 kB
Tags Source
SHA-256 checksum
How to use checksums
404a963c376817a158b41a6e0353a1d73823619b60cbf6a6f9bfb708fd9ef9f4
BLAKE2b-256 checksum
How to use checksums
a58e88c6008103c3b79909cc44353ea015d608e5537ec11d9eaa6d62995ba08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for encodingcontext 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.0 This release

1 release file No provenance

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