Skip to content

Commit 693c1f1

Browse files
fix: Fix abs_path bug in serialize_frame
Fixes #4587
1 parent b065719 commit 693c1f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sentry_sdk/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,14 @@ def serialize_frame(
591591
if tb_lineno is None:
592592
tb_lineno = frame.f_lineno
593593

594+
try:
595+
os_abs_path = os.path.abspath(abs_path) if abs_path else None
596+
except Exception:
597+
os_abs_path = None
598+
594599
rv = {
595600
"filename": filename_for_module(module, abs_path) or None,
596-
"abs_path": os.path.abspath(abs_path) if abs_path else None,
601+
"abs_path": os_abs_path,
597602
"function": function or "<unknown>",
598603
"module": module,
599604
"lineno": tb_lineno,

0 commit comments

Comments
 (0)