Skip to content

Commit

Permalink
Adding escape call to sitecustomize sub call.
Browse files Browse the repository at this point in the history
Fixes auto-instrumentation not producing spans on Windows. See the
following issue:
https://github.com/open-telemetry/opentelemetry-python/issues/2703
  • Loading branch information
jeremydvoss committed May 19, 2022
1 parent 10659f8 commit ea0cf3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.12.0rc1-0.31b0...HEAD)

- Adding escape call to fix [auto-instrumentation not producing spans on Windows](https://github.com/open-telemetry/opentelemetry-python/issues/2703).
([#<PR>](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/<PR>))

## [1.12.0rc1-0.31b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc1-0.31b0) - 2022-05-17


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from logging import getLogger
from os import environ
from os.path import abspath, dirname, pathsep
from re import sub
from re import sub, escape

from pkg_resources import iter_entry_points

Expand Down Expand Up @@ -112,7 +112,7 @@ def _load_configurators():
def initialize():
# prevents auto-instrumentation of subprocesses if code execs another python process
environ["PYTHONPATH"] = sub(
rf"{dirname(abspath(__file__))}{pathsep}?",
escape(rf"{dirname(abspath(__file__))}{pathsep}?"),
"",
environ["PYTHONPATH"],
)
Expand Down

0 comments on commit ea0cf3f

Please sign in to comment.