posthog 7.91.2__tar.gz → 7.91.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {posthog-7.91.2/posthog.egg-info → posthog-7.91.4}/PKG-INFO +1 -1
- {posthog-7.91.2 → posthog-7.91.4}/posthog/async_client.py +8 -2
- {posthog-7.91.2 → posthog-7.91.4}/posthog/client.py +8 -3
- {posthog-7.91.2 → posthog-7.91.4}/posthog/exception_capture.py +79 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/exception_utils.py +14 -8
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_exception_capture.py +46 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_exception_utils.py +17 -0
- posthog-7.91.4/posthog/version.py +1 -0
- {posthog-7.91.2 → posthog-7.91.4/posthog.egg-info}/PKG-INFO +1 -1
- {posthog-7.91.2 → posthog-7.91.4}/pyproject.toml +1 -1
- posthog-7.91.2/posthog/version.py +0 -1
- {posthog-7.91.2 → posthog-7.91.4}/LICENSE +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/MANIFEST.in +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/README.md +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/_async_consumer.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/_async_request.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/_async_utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/_disabled_lane_queue.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/_logging.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/_metrics_autocapture.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/anthropic/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/anthropic/_anthropic_stream.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/anthropic/anthropic.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/anthropic/anthropic_async.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/anthropic/anthropic_converter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/anthropic/anthropic_providers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/claude_agent_sdk/client.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/claude_agent_sdk/formatting.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/claude_agent_sdk/processor.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_async_datasets.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_client.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_dataset_serialization.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_dataset_types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_datasets.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_errors.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_scorer_types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_scorers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_serialization.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_tags.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_transport.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/evaluations/_types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/gateway.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/gemini/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/gemini/_shared.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/gemini/gemini.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/gemini/gemini_async.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/gemini/gemini_converter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/langchain/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/langchain/callbacks.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/langchain/middleware.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/media.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/_embeddings.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/_streaming.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/openai.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/openai_async.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/openai_converter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/openai_providers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai/wrapper_utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai_agents/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/openai_agents/processor.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/otel/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/otel/_privacy.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/otel/_request_context.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/otel/exporter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/otel/processor.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/otel/spans.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/prompts.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/sanitization.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/stream.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/ai/utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/args.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/bucketed_rate_limiter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/capture_compression.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/capture_mode.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/capture_v1.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/consumer.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/contexts.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/emails.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/feature_flag_evaluations.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/feature_flags.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/flag_definition_cache.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/_tracing_headers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/asgi.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/celery.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/django.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/drf.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/flask.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/integrations/otel.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_argument_ownership.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_capture.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_compatibility.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_context_parameters.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_conversation_id.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_event_types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_exceptions.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_ids.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_instrument_fastmcp.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_instrument_lowlevel.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_instrument_v2.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_instrumentation.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_intent.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_internal.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_lib_identity.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_model_parameters.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_output_instructions.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_posthog_events.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_raised_tool_error.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_sanitization.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_server_build.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_sink.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_tool_input.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_transport_identity.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/_truncation.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/asgi.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/constants.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/feedback.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/logger.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/posthog_mcp.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/request_headers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/session.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/session_token.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/tools.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/mcp/version.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/metrics_capture.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/poller.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/py.typed +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/release_id.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/request.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/claude_agent_sdk/test_client.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/claude_agent_sdk/test_processor.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/claude_agent_sdk/test_processor_content.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/openai_agents/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/openai_agents/test_processor.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/otel/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/otel/conftest.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/otel/test_exporter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/otel/test_processor.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/otel/test_spans.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_async_cancellation.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_async_stream_wrapper.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_capture_contract.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_capture_pipeline.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_evaluations.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_evaluations_datasets.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_evaluations_scorers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_evaluations_transport.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_gateway.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_http_status.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_media.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_privacy_mode.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_prompts.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_sanitization.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_stream_midstream_error.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_system_prompts.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_token_reporting.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_tokens_source.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/test_utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/ai/utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/conftest.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/logging_helpers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/_helpers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/_helpers_lowlevel.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/_helpers_v2.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/conftest.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_asgi.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_capture.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_conversation_session.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_defaults.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_error_properties.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_error_status.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_fastmcp.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_fastmcp_tool_errors.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_fastmcp_v2.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_fastmcp_v4.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_features_m4.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_feedback.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_initialize_handshake.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_instrument_lowlevel_ownership.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_instrument_v2.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_instrumentation_fork.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_lowlevel.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_model_parameters.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_no_crash.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_output_instructions.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_pending_tasks.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_pipeline.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_posthog_mcp.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_request_headers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_resources.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_review_fixes.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_send_tools_list_event.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_session_token.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_tool_input.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_transport_identity.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_truncation.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_units.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_unknown_tool.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_v2_lowlevel.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_v2_mcpserver.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_v2_wire_dual_era.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/mcp/test_virtual_tools.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/released_flags_scenarios.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_ai_capture_lane.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_async_client.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_async_consumer.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_async_feature_flags.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_async_request.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_async_utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_before_send.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_bucketed_rate_limiter.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_capture_compression.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_capture_mode.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_capture_v1.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_client.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_client_crap_flags.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_client_fork.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_code_variables.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_consumer.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_contexts.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_emails.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_evaluate_flags.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_experiment_exposure.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_failed_flag_records.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_feature_flag.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_feature_flag_called_minimization.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_feature_flag_has_experiment.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_feature_flag_result.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_feature_flags.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_feature_flags_regex.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_flag_cache_eviction_reads.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_flag_cache_publication.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_flag_definition_cache.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_flag_payload_parsing.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_flags_released_behaviour.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_flags_v4_response.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_gevent_compat.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_metrics.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_metrics_autocapture.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_module.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_posthog_upgrade_workflow.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_property_matching_version.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_redis_flag_cache_snapshot.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_reference_markdown.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_release_id.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_request.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_server_payload_snapshots.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_size_limited_dict.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/test_utils_acceptance.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/conftest.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/helpers.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_client_traces.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_config.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_export.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_ids.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_limits.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_otlp.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_pipeline.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_sanitize.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_span.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_traceparent.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/test/tracing/test_transport.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/__init__.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_before_span_send.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_config.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_context.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_drops.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_export.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_ids.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_limits.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_otlp.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_pipeline.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_sanitize.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_span.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_traceparent.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/_transport.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/tracing/span.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/types.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog/utils.py +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog.egg-info/SOURCES.txt +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog.egg-info/dependency_links.txt +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog.egg-info/requires.txt +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/posthog.egg-info/top_level.txt +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/setup.cfg +0 -0
- {posthog-7.91.2 → posthog-7.91.4}/setup.py +0 -0
|
@@ -928,8 +928,10 @@ class AsyncClient:
|
|
|
928
928
|
flags=kwargs.get("flags"),
|
|
929
929
|
disable_geoip=kwargs.get("disable_geoip"),
|
|
930
930
|
)
|
|
931
|
-
|
|
932
|
-
|
|
931
|
+
# Mark the exception as captured to prevent duplicate captures,
|
|
932
|
+
# including one taken from sys.exc_info()
|
|
933
|
+
if result is not None:
|
|
934
|
+
mark_exception_as_captured(exc_info, result)
|
|
933
935
|
return result
|
|
934
936
|
except Exception as error:
|
|
935
937
|
self.log.exception("Failed to capture exception: %s", error)
|
|
@@ -983,6 +985,10 @@ class AsyncClient:
|
|
|
983
985
|
self.log.warning("No exception information available")
|
|
984
986
|
return None
|
|
985
987
|
|
|
988
|
+
if exception is None and exception_is_already_captured(exc_info):
|
|
989
|
+
self.log.debug("Exception already captured, skipping")
|
|
990
|
+
return None
|
|
991
|
+
|
|
986
992
|
return exc_info
|
|
987
993
|
|
|
988
994
|
def _get_feature_flag_evaluations_host(self) -> _FeatureFlagEvaluationsHost:
|
|
@@ -2932,9 +2932,10 @@ class Client(object):
|
|
|
2932
2932
|
disable_geoip=disable_geoip,
|
|
2933
2933
|
)
|
|
2934
2934
|
|
|
2935
|
-
# Mark the exception as captured to prevent duplicate captures
|
|
2936
|
-
|
|
2937
|
-
|
|
2935
|
+
# Mark the exception as captured to prevent duplicate captures,
|
|
2936
|
+
# including one taken from sys.exc_info()
|
|
2937
|
+
if res is not None:
|
|
2938
|
+
mark_exception_as_captured(exc_info, res)
|
|
2938
2939
|
|
|
2939
2940
|
return res
|
|
2940
2941
|
except Exception as e:
|
|
@@ -2956,6 +2957,10 @@ class Client(object):
|
|
|
2956
2957
|
self.log.warning("No exception information available")
|
|
2957
2958
|
return None
|
|
2958
2959
|
|
|
2960
|
+
if exception is None and exception_is_already_captured(exc_info):
|
|
2961
|
+
self.log.debug("Exception already captured, skipping")
|
|
2962
|
+
return None
|
|
2963
|
+
|
|
2959
2964
|
return exc_info
|
|
2960
2965
|
|
|
2961
2966
|
def _exception_properties(self, exc_info, properties, kwargs):
|
|
@@ -20,6 +20,16 @@ if TYPE_CHECKING:
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class ExceptionCapture:
|
|
23
|
+
"""Installs process-wide exception hooks that forward uncaught exceptions to PostHog.
|
|
24
|
+
|
|
25
|
+
Hooks are installed on :attr:`sys.excepthook` (main-thread unhandled exceptions) and
|
|
26
|
+
:attr:`threading.excepthook` (exceptions that escape worker threads). The original
|
|
27
|
+
hooks are restored when :meth:`close` is called.
|
|
28
|
+
|
|
29
|
+
Optionally enforces client-side rate limiting per exception type so that a sudden
|
|
30
|
+
burst of identical errors does not flood the PostHog ingestion pipeline.
|
|
31
|
+
"""
|
|
32
|
+
|
|
23
33
|
log = logging.getLogger("posthog")
|
|
24
34
|
|
|
25
35
|
# more generous defaults than the browser SDK (10, 1, 10) because one
|
|
@@ -36,6 +46,22 @@ class ExceptionCapture:
|
|
|
36
46
|
refill_rate=DEFAULT_REFILL_RATE,
|
|
37
47
|
refill_interval_seconds=DEFAULT_REFILL_INTERVAL_SECONDS,
|
|
38
48
|
):
|
|
49
|
+
"""Install exception hooks and configure optional rate limiting.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
client: The PostHog :class:`~posthog.client.Client` used to send captured exceptions.
|
|
53
|
+
rate_limiting_enabled: When ``True``, a :class:`~posthog.bucketed_rate_limiter.BucketedRateLimiter`
|
|
54
|
+
is created with the given bucket parameters to suppress excess captures of the same
|
|
55
|
+
exception type.
|
|
56
|
+
bucket_size: Token capacity of the rate-limiting bucket per exception type.
|
|
57
|
+
Because the call that empties the bucket is itself treated as rate-limited,
|
|
58
|
+
a fresh bucket permits ``bucket_size - 1`` captures before limiting takes
|
|
59
|
+
effect. Clamped to ``[0, 100]``. Default is :attr:`DEFAULT_BUCKET_SIZE` (``50``).
|
|
60
|
+
refill_rate: Tokens restored per completed ``refill_interval_seconds`` interval.
|
|
61
|
+
Clamped to ``[0, bucket_size]``. Default is :attr:`DEFAULT_REFILL_RATE` (``10``).
|
|
62
|
+
refill_interval_seconds: Duration of each refill interval in seconds.
|
|
63
|
+
Clamped to ``[0, 86400]``. Default is :attr:`DEFAULT_REFILL_INTERVAL_SECONDS` (``10``).
|
|
64
|
+
"""
|
|
39
65
|
self.client = client
|
|
40
66
|
self._closed = False
|
|
41
67
|
self.original_excepthook = sys.excepthook
|
|
@@ -55,6 +81,15 @@ class ExceptionCapture:
|
|
|
55
81
|
)
|
|
56
82
|
|
|
57
83
|
def close(self):
|
|
84
|
+
"""Uninstall exception hooks and restore the hooks that were in place at construction time.
|
|
85
|
+
|
|
86
|
+
Idempotent: calling :meth:`close` a second time has no effect. After closing,
|
|
87
|
+
the rate limiter (if any) is also stopped and its per-key buckets are cleared.
|
|
88
|
+
|
|
89
|
+
This method is intentionally not thread-safe with respect to concurrent :meth:`close`
|
|
90
|
+
calls; callers that share an :class:`ExceptionCapture` across threads should arrange
|
|
91
|
+
external synchronisation if they need to close it concurrently.
|
|
92
|
+
"""
|
|
58
93
|
if self._closed:
|
|
59
94
|
return
|
|
60
95
|
|
|
@@ -83,6 +118,17 @@ class ExceptionCapture:
|
|
|
83
118
|
self._rate_limiter.stop()
|
|
84
119
|
|
|
85
120
|
def exception_handler(self, exc_type, exc_value, exc_traceback):
|
|
121
|
+
"""Handle an unhandled exception from :attr:`sys.excepthook`.
|
|
122
|
+
|
|
123
|
+
Forwards the exception to PostHog with ``level="fatal"`` and
|
|
124
|
+
``mechanism.type="onuncaughtexception"``, then delegates to the previous
|
|
125
|
+
``sys.excepthook`` so that normal Python crash output is preserved.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
exc_type: The exception class.
|
|
129
|
+
exc_value: The exception instance.
|
|
130
|
+
exc_traceback: The traceback object.
|
|
131
|
+
"""
|
|
86
132
|
if not self._closed:
|
|
87
133
|
capture_metadata: _ExceptionCaptureMetadata = {
|
|
88
134
|
"level": "fatal",
|
|
@@ -104,6 +150,16 @@ class ExceptionCapture:
|
|
|
104
150
|
previous_hook(exc_type, exc_value, exc_traceback)
|
|
105
151
|
|
|
106
152
|
def thread_exception_handler(self, args):
|
|
153
|
+
"""Handle an unhandled exception from :attr:`threading.excepthook`.
|
|
154
|
+
|
|
155
|
+
Forwards the exception to PostHog with ``level="error"`` and
|
|
156
|
+
``mechanism.type="onuncaughtexception"``, then delegates to the previous
|
|
157
|
+
``threading.excepthook``.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
args: The :class:`threading.ExceptHookArgs` object supplied by the threading machinery,
|
|
161
|
+
containing ``exc_type``, ``exc_value``, ``exc_traceback``, and ``thread``.
|
|
162
|
+
"""
|
|
107
163
|
if not self._closed:
|
|
108
164
|
capture_metadata: _ExceptionCaptureMetadata = {
|
|
109
165
|
"level": "error",
|
|
@@ -136,6 +192,17 @@ class ExceptionCapture:
|
|
|
136
192
|
hook = getattr(owner, previous_hook_name)
|
|
137
193
|
|
|
138
194
|
def exception_receiver(self, exc_info, extra_properties):
|
|
195
|
+
"""Receive an exception from an external caller and forward it to PostHog.
|
|
196
|
+
|
|
197
|
+
Provides an entry point for external callers to pass an ``exc_info`` tuple
|
|
198
|
+
and extra properties (such as ``"distinct_id"``) into the exception capture
|
|
199
|
+
pipeline without going through :attr:`sys.excepthook`.
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
exc_info: A three-tuple ``(exc_type, exc_value, exc_traceback)``.
|
|
203
|
+
extra_properties: A mapping of extra properties. If it contains a ``"distinct_id"``
|
|
204
|
+
key, that value is used as the PostHog distinct ID for the captured event.
|
|
205
|
+
"""
|
|
139
206
|
if "distinct_id" in extra_properties:
|
|
140
207
|
metadata = {"distinct_id": extra_properties["distinct_id"]}
|
|
141
208
|
else:
|
|
@@ -143,6 +210,18 @@ class ExceptionCapture:
|
|
|
143
210
|
self.capture_exception((exc_info[0], exc_info[1], exc_info[2]), metadata)
|
|
144
211
|
|
|
145
212
|
def capture_exception(self, exception, metadata=None):
|
|
213
|
+
"""Capture a single exception and send it to PostHog.
|
|
214
|
+
|
|
215
|
+
A convenience wrapper around the internal :meth:`_capture_exception` method intended
|
|
216
|
+
for direct call sites that already hold an exception object or ``(type, value, tb)``
|
|
217
|
+
tuple outside of the ``sys.excepthook`` flow.
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
exception: Either an :class:`Exception` instance or a three-tuple
|
|
221
|
+
``(exc_type, exc_value, exc_traceback)`` as returned by :func:`sys.exc_info`.
|
|
222
|
+
metadata: Optional mapping with an optional ``"distinct_id"`` key to associate
|
|
223
|
+
the event with a specific PostHog person.
|
|
224
|
+
"""
|
|
146
225
|
self._capture_exception(exception, metadata)
|
|
147
226
|
|
|
148
227
|
def _capture_exception(
|
|
@@ -413,7 +413,7 @@ def get_lines_from_file(
|
|
|
413
413
|
loader=None, # type: Optional[Any]
|
|
414
414
|
module=None, # type: Optional[str]
|
|
415
415
|
):
|
|
416
|
-
# type: (...) -> Tuple[List[
|
|
416
|
+
# type: (...) -> Tuple[List[str], Optional[str], List[str]]
|
|
417
417
|
context_lines = 5
|
|
418
418
|
source = _get_source_lines(filename, loader, module)
|
|
419
419
|
|
|
@@ -423,14 +423,20 @@ def get_lines_from_file(
|
|
|
423
423
|
lower_bound = max(0, lineno - context_lines)
|
|
424
424
|
upper_bound = min(lineno + 1 + context_lines, len(source))
|
|
425
425
|
|
|
426
|
+
def strip_line(line):
|
|
427
|
+
# type: (str) -> str
|
|
428
|
+
# strip_string wraps a truncated line in an AnnotatedValue, which the
|
|
429
|
+
# event payload can't serialize, so keep only the truncated text.
|
|
430
|
+
stripped = strip_string(line.strip("\r\n"), max_length=max_length)
|
|
431
|
+
if isinstance(stripped, AnnotatedValue):
|
|
432
|
+
return cast(str, stripped.value)
|
|
433
|
+
return stripped
|
|
434
|
+
|
|
426
435
|
try:
|
|
427
|
-
pre_context = [
|
|
428
|
-
|
|
429
|
-
for line in source[lower_bound:lineno]
|
|
430
|
-
]
|
|
431
|
-
context_line = strip_string(source[lineno].strip("\r\n"), max_length=max_length)
|
|
436
|
+
pre_context = [strip_line(line) for line in source[lower_bound:lineno]]
|
|
437
|
+
context_line = strip_line(source[lineno])
|
|
432
438
|
post_context = [
|
|
433
|
-
|
|
439
|
+
strip_line(line)
|
|
434
440
|
for line in source[(lineno + 1) : upper_bound] # noqa: E203
|
|
435
441
|
]
|
|
436
442
|
return pre_context, context_line, post_context
|
|
@@ -464,7 +470,7 @@ def get_source_context(
|
|
|
464
470
|
tb_lineno, # type: int
|
|
465
471
|
max_value_length=None, # type: Optional[int]
|
|
466
472
|
):
|
|
467
|
-
# type: (...) -> Tuple[List[
|
|
473
|
+
# type: (...) -> Tuple[List[str], Optional[str], List[str]]
|
|
468
474
|
try:
|
|
469
475
|
abs_path = frame.f_code.co_filename # type: Optional[str]
|
|
470
476
|
except Exception:
|
|
@@ -743,3 +743,49 @@ def test_never_raised_exception_stack_omits_sdk_frames_in_renamed_package():
|
|
|
743
743
|
functions = [frame["function"] for frame in exception["stacktrace"]["frames"]]
|
|
744
744
|
assert functions[-1] == "handler"
|
|
745
745
|
assert exception["mechanism"]["synthetic"] is True
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
def _captured_events(client_class, capture_handled, pass_exception):
|
|
749
|
+
from posthog.async_client import AsyncClient
|
|
750
|
+
from posthog.client import Client
|
|
751
|
+
|
|
752
|
+
clients = {"Client": Client, "AsyncClient": AsyncClient}
|
|
753
|
+
client = clients[client_class]("phc_test", send=False)
|
|
754
|
+
with patch.object(client, "capture", wraps=client.capture) as capture:
|
|
755
|
+
try:
|
|
756
|
+
capture_handled(client, pass_exception)
|
|
757
|
+
except ZeroDivisionError:
|
|
758
|
+
pass
|
|
759
|
+
return [call.args[0] for call in capture.call_args_list]
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
def _handled_then_reraised_in_context(client, pass_exception):
|
|
763
|
+
from posthog.contexts import new_context
|
|
764
|
+
|
|
765
|
+
with new_context(capture_exceptions=True, client=client):
|
|
766
|
+
try:
|
|
767
|
+
1 / 0
|
|
768
|
+
except ZeroDivisionError as error:
|
|
769
|
+
client.capture_exception(error if pass_exception else None)
|
|
770
|
+
raise
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
def _handled_twice(client, pass_exception):
|
|
774
|
+
try:
|
|
775
|
+
1 / 0
|
|
776
|
+
except ZeroDivisionError as error:
|
|
777
|
+
client.capture_exception(error if pass_exception else None)
|
|
778
|
+
client.capture_exception(error if pass_exception else None)
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
@pytest.mark.parametrize("client_class", ["Client", "AsyncClient"])
|
|
782
|
+
@pytest.mark.parametrize("pass_exception", [True, False])
|
|
783
|
+
@pytest.mark.parametrize(
|
|
784
|
+
"capture_handled", [_handled_then_reraised_in_context, _handled_twice]
|
|
785
|
+
)
|
|
786
|
+
def test_exception_from_sys_exc_info_is_captured_once(
|
|
787
|
+
client_class, capture_handled, pass_exception
|
|
788
|
+
):
|
|
789
|
+
assert _captured_events(client_class, capture_handled, pass_exception) == [
|
|
790
|
+
"$exception"
|
|
791
|
+
]
|
|
@@ -61,6 +61,23 @@ def test_source_context_falls_back_when_loader_cannot_read_source(tmp_path, fail
|
|
|
61
61
|
) == ([], "current", ["after"])
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
def test_source_context_truncates_long_lines_to_strings(tmp_path):
|
|
65
|
+
long_line = "x" * 1100
|
|
66
|
+
source = tmp_path / "application.py"
|
|
67
|
+
source.write_text("\n".join([long_line, long_line, long_line]))
|
|
68
|
+
|
|
69
|
+
pre_context, context_line, post_context = exception_utils.get_lines_from_file(
|
|
70
|
+
str(source), 1
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
truncated = "x" * 1021 + "..."
|
|
74
|
+
assert (pre_context, context_line, post_context) == (
|
|
75
|
+
[truncated],
|
|
76
|
+
truncated,
|
|
77
|
+
[truncated],
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
64
81
|
def test_source_context_handles_changed_files(tmp_path):
|
|
65
82
|
source = tmp_path / "application.py"
|
|
66
83
|
source.write_text("current\n")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "7.91.4"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "posthog"
|
|
7
|
-
version = "7.91.
|
|
7
|
+
version = "7.91.4"
|
|
8
8
|
description = "Integrate PostHog into any python application."
|
|
9
9
|
authors = [{ name = "PostHog", email = "engineering@posthog.com" }]
|
|
10
10
|
maintainers = [{ name = "PostHog", email = "engineering@posthog.com" }]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "7.91.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|