From a834bd4a8b1304bd3babd80ee995dcd04e244962 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Wed, 26 Feb 2025 12:26:32 +0000 Subject: [PATCH 1/2] Use File.open in LineCache --- sentry-ruby/lib/sentry/linecache.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sentry-ruby/lib/sentry/linecache.rb b/sentry-ruby/lib/sentry/linecache.rb index 38c18b99b..e60b4beed 100644 --- a/sentry-ruby/lib/sentry/linecache.rb +++ b/sentry-ruby/lib/sentry/linecache.rb @@ -29,9 +29,9 @@ def valid_path?(path) def getlines(path) @cache[path] ||= begin - IO.readlines(path) - rescue - nil + File.open(path, "r", &:readlines) + rescue + nil end end From 0c965f4f8fcfcf152cbdf32518a9ed67fe0a02f2 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Wed, 26 Feb 2025 12:44:27 +0000 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dc4061ee..4521171ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - Prevent starting Vernier in nested transactions ([#2528](https://github.com/getsentry/sentry-ruby/pull/2528)) - Fix TypeError when Resque.inline == true ([#2564] https://github.com/getsentry/sentry-ruby/pull/2564) +### Internal + +- Use `File.open` in `LineCache` ([#2566](https://github.com/getsentry/sentry-ruby/pull/2566)) + ### Miscellaneous - Deprecate `enable_tracing` in favor of `traces_sample_rate = 1.0` [#2535](https://github.com/getsentry/sentry-ruby/pull/2535)