Skip to content

IO.popen fails to find executable with chdir: kwarg #8216

@segiddins

Description

@segiddins

Environment Information

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
    9.4.6.0
  • Operating system and platform (e.g. uname -a)
    Darwin sr-71 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64
irb(main):001> IO.popen(["echo", "hi"], &:read)
=> "hi\n"
irb(main):002> IO.popen(["echo", "hi"], chdir: "/", &:read)
org/jruby/RubyIO.java:4494:in `popen': No such file or directory - echo (Errno::ENOENT)
        from (irb):2:in `evaluate'
        from org/jruby/RubyKernel.java:1265:in `eval'
        from org/jruby/RubyKernel.java:1707:in `loop'
        from org/jruby/RubyKernel.java:1414:in `catch'
        from /Users/segiddins/.gem/jruby/3.1.4/gems/irb-1.8.1/exe/irb:9:in `<main>'
        from org/jruby/RubyKernel.java:1211:in `load'
        from /Users/segiddins/.gem/jruby/3.1.4/bin/irb:25:in `<main>'

This works on MRI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions