Skip to content

try-catch + ascii_downcase fails in "catch" condition #3016

@gursewak1997

Description

@gursewak1997

I see an error when we run a jq statement using try-catch and ascii_downcase. If it has a match, it doesn't error out but when it needs to take the catch path, it errors out.
This issue was seen after upgrading the jq from jq 1.6-17.fc39 -> jq-1.7.1-1.fc40
OS I am runnning on: Fedora CoreOS-Rawhide.

Steps to Reproduce:

  1. Run jq -r 'map(select(try .baz catch "" | ascii_downcase == ""))' <<< '[{"foo":"bar"}]'

Actual results:
jq: error (at <stdin>:1): explode input must be a string
Expected results:

[
  {
    "foo": "bar"
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions