Repository navigation
Make every opt-out fail closed (0.5.0) - #45
Merged
Merged
Conversation
A switch that does not clearly mean "on" now turns reporting off, so an opt-out can never be read as consent (trace-client-java 0.8.0 counterpart): - TRACE_USAGE_REPORTING set to anything but blank or true/on/yes/1 now disables; only off/false/0/no did, so "disabled" or a typo left it on. - DO_NOT_TRACK set to anything but blank or 0/false/off/no now disables; only 1/true/yes did. - An environment that cannot be read (or holds a non-string value) now disables instead of raising out of the constructor. - enabled= is read through the new allows_reporting(), so enabled="false", None or 0 is off; it used to be any truthy value, so the string "false" reported. - New allows_reporting(setting): True only for True or a string true/on/yes/1; README examples use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every opt-out now fails closed: a switch that does not clearly mean "on" turns usage reporting off, so a disabled setting can never be read as consent. This is the Python counterpart of Stephenson-Software/trace-client-java#51 (0.8.0).
Fail-open paths fixed
TRACE_USAGE_REPORTINGonly turned reporting off foroff/false/0/no;disabledor a typo left it on. Now anything but blank ortrue/on/yes/1turns it off.DO_NOT_TRACKonly turned reporting off for1/true/yes. Now anything but blank or0/false/off/noturns it off.enabled=was a truthiness check, soenabled="false"(a string from a config file) reported. It is now read throughallows_reporting(): onlyTrueor a stringtrue/on/yes/1is on;None, numbers, typos and"false"are off. Leaving it out still defaults to on.New helper
allows_reporting(setting)(exported fromtrace_client), the equivalent ofTraceClient.allowsReporting(Object)in Java. The README "Turning it off" section documents it and the README examples pass the program's own flag through it.The client reads no config-file switch of its own (the install-ID file holds only an ID), so the file rules do not apply.
Version
0.4.2 → 0.5.0 in
pyproject.toml,__version__and both module headers. No CHANGELOG in this repo.Tests
python -m unittest: 85 tests, OK. Tests pinning the fail-open environment values were updated; new tests cover unfamiliarTRACE_USAGE_REPORTING/DO_NOT_TRACKvalues, an unreadable environment,allows_reporting, andenabled=strings/None/numbers.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson