Skip to content

Commit 04e5a90

Browse files
authoredFeb 26, 2025
Use File.open in LineCache (#2566)
* Use File.open in LineCache * Update CHANGELOG
1 parent bd78c29 commit 04e5a90

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
- Prevent starting Vernier in nested transactions ([#2528](https://github.com/getsentry/sentry-ruby/pull/2528))
1111
- Fix TypeError when Resque.inline == true ([#2564] https://github.com/getsentry/sentry-ruby/pull/2564)
1212

13+
### Internal
14+
15+
- Use `File.open` in `LineCache` ([#2566](https://github.com/getsentry/sentry-ruby/pull/2566))
16+
1317
### Miscellaneous
1418

1519
- Deprecate `enable_tracing` in favor of `traces_sample_rate = 1.0` [#2535](https://github.com/getsentry/sentry-ruby/pull/2535)

‎sentry-ruby/lib/sentry/linecache.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def valid_path?(path)
2929

3030
def getlines(path)
3131
@cache[path] ||= begin
32-
IO.readlines(path)
33-
rescue
34-
nil
32+
File.open(path, "r", &:readlines)
33+
rescue
34+
nil
3535
end
3636
end
3737

0 commit comments

Comments
 (0)