Config parameter initial_reconnect_delay allows customizing of the base retry delay for stream connections (that is, the delay for the first reconnection after a failure; subsequent retries use an exponential backoff).Config parameter http and the HTTPConfig class allow advanced configuration of the SDK's network behavior, such as specifying a custom certificate authority for connecting to a proxy/gateway that uses a self-signed certificate.Config properties connect_timeout, read_timeout, and verify_ssl are now deprecated and superseded by the equivalent properties in HTTPConfig.verify_ssl to False in the client configuration did not have the expected effect of completely turning off SSL/TLS verification, because it still left certificate verification in effect, so it would allow a totally insecure connection but reject a secure connection whose certificate had an unknown CA. This has been changed so that it will turn off certificate verification as well. This is not a recommended practice and a future version of the SDK will add a way to specify a custom certificate authority instead (to support, for instance, using the Relay Proxy with a self-signed certificate).Note: if you are using the LaunchDarkly Relay Proxy to forward events, update the Relay to version 5.10.0 or later before updating to this Python SDK version.
diagnostic_opt_out option or configured with diagnostic_recording_interval.Files.new_data_source() to use yaml.safe_load() instead of yaml.load() for YAML/JSON test data parsing. This disables pyyaml extended syntax features that could allow arbitrary code execution. (#136)expiringdict.SyntaxWarning in Python 3.8. (Thanks, bunchesofdonald!)SyntaxWarning will always cause a build failure, and added a 3.8 build.Config parameter http_proxy allows you to specify a proxy server programmatically rather than by using environment variables. This may be helpful if you want the SDK to use a proxy, but do not want other Python code to use the proxy. (Thanks, gangeli!)https_proxy environment variable for specifying a proxy (because that variable is not used by urllib3). This has been fixed.__dict__.LDClient.track().variation while waiting for the internal event processing logic to catch up with the backlog. The logic has been changed to drop events if necessary so threads will not be blocked (similar to how the SDK already drops events if the size of the event buffer is exceeded). If that happens, this warning message will be logged once: "Events are being produced faster than they can be processed; some events will be dropped". Under normal conditions this should never happen; this change is meant to avoid a concurrency bottleneck in applications that are already so busy that thread starvation is likely.Logger.warn() were causing deprecation warnings in some versions of Python. Changed these to Logger.warning(). (#125)ldclient-py to launchdarkly-server-sdkThere are no other changes in this release. Substituting ldclient-py version 6.9.1 with launchdarkly-server-sdk version 6.9.2 will not affect functionality. Be sure to uninstall the ldclient-py dependency from your runtime environment when making this change.
set_sdk_key function was comparing the existing SDK key (if any) to the new one by identity (is) rather than equality (==). In Python, two strings that have the same characters may or may not be the same string instance; in the case where they were not, set_sdk_key would inappropriately reinitialize the client even though the SDK key had not really changed. (Thanks, jpgimenez!)CONTRIBUTING.md.The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now python-server-sdk rather than python-client.
The package name will also change. In the 6.9.1 release, it is still ldclient-py; in all future releases, it will be launchdarkly-server-sdk. No further updates to the ldclient-py package will be published after this release.
with statement on an LDClient object, so that close() will be called automatically when it goes out of scope.close() on the client would cause an error if the configuration included use_ldd=True. (#118)track or identify is called without a user, the SDK now logs a warning, and does not send an analytics event to LaunchDarkly (since it would not be processed without a user).Note that starting with this release, generated API documentation is available online at https://launchdarkly-python-sdk.readthedocs.io. This is published automatically from the documentation comments in the code.
jsonpickle.pip. Our CI tests have been updated and should prevent this in the future.