Skip to content

Used the wrong escape character '\'? #12391

@Nomango

Description

@Nomango

SDK

Python SDK

Description

For example, in this document, there is a backslash in the regular expression string.

import sentry_sdk

sentry_sdk.init(
    dsn="xxx",
    trace_propagation_targets=[
        "https://myproject.org",
+       "https://.*\.otherservice.org/.*",
    ],
    # ...
)

Suggested Solution

Use raw string instead

import sentry_sdk

sentry_sdk.init(
    dsn="xxx",
    trace_propagation_targets=[
        "https://myproject.org",
-       "https://.*\.otherservice.org/.*",
+       r"https://.*\.otherservice.org/.*",
    ],
    # ...
)

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Support

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions