[ruby-core:116621] [Ruby master Feature#20244] Show the conflicting another chdir block
From:
"nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@...>
Date:
2024-02-07 16:35:43 UTC
List:
ruby-core #116621
Issue #20244 has been reported by nobu (Nobuyoshi Nakada).
----------------------------------------
Feature #20244: Show the conflicting another chdir block
https://bugs.ruby-lang.org/issues/20244
* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
----------------------------------------
`Dir.chdir` is warning when in another `chdir` block.
```sh-session
$ ruby -e 'Dir.chdir {' -e 'Dir.chdir("/")' -e '}'
-e:2: warning: conflicting chdir during another chdir block
```
If two `chdir`s are far apart, it can be difficult to find conflicting blocks.
To help the debugging, I propose to improve the warning message to show the conflicting block.
```sh-session
$ ./ruby -e 'Dir.chdir {' -e 'Dir.chdir("/")' -e '}'
-e:2: warning: conflicting chdir during another chdir block
-e:1: warning: here
```
https://github.com/ruby/ruby/pull/9870
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/