Skip to content

Commit 296ec8d

Browse files
committed
fix: Unify trace paths
Before at some places of the trace the path was relative and at others it was full. Now it should be full everywhere Issue description
1 parent 1cceecc commit 296ec8d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

codetracer-python-recorder/codetracer_python_recorder/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def main(argv: list[str] | None = None) -> int:
5656
sys.stderr.write("Usage: python -m codetracer_python_recorder [codetracer options] <script.py> [args...]\n")
5757
return 2
5858

59-
script_path = Path(unknown[0])
59+
script_path = Path(unknown[0]).resolve()
6060
script_args = unknown[1:]
6161

6262
fmt = ns.format or DEFAULT_FORMAT
@@ -71,7 +71,7 @@ def main(argv: list[str] | None = None) -> int:
7171
start_on_enter=script_path,
7272
)
7373
try:
74-
runpy.run_path(str(script_path.resolve()), run_name="__main__")
74+
runpy.run_path(str(script_path), run_name="__main__")
7575
return 0
7676
except SystemExit as e:
7777
# Preserve script's exit code

codetracer-python-recorder/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ fn start_tracing(
104104

105105
// Start location: prefer activation path, otherwise best-effort argv[0]
106106
let start_path: &Path = activation_path.unwrap_or(Path::new(&program));
107+
log::debug!("{}", start_path.display());
107108
tracer.begin(&meta_path, &paths_path, &events_path, start_path, 1)?;
108109

109110
// Install callbacks

codetracer-python-recorder/src/runtime_tracer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Tracer for RuntimeTracer {
172172
}
173173
// Determine whether this is the activation owner's return
174174
let is_activation_return = self.activation_code_id.map(|id| id == code.id()).unwrap_or(false);
175-
// Return value is optional per configuration
175+
176176
let val = self.encode_value(py, retval);
177177
TraceWriter::register_return(&mut self.writer, val);
178178
if is_activation_return {

0 commit comments

Comments
 (0)