Bug 2417867 - json_pp complains about duplicate command-line option specs. ignores -v (verbose) flag
Summary: json_pp complains about duplicate command-line option specs. ignores -v (verb...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-JSON-PP
Version: 43
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Paul Howarth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-11-30 11:22 UTC by "FeRD" (Frank Dana)
Modified: 2025-12-25 00:53 UTC (History)
2 users (show)

Fixed In Version: perl-JSON-PP-4.16-522.fc44 perl-JSON-PP-4.16-522.fc43
Clone Of:
Environment:
Last Closed: 2025-12-23 16:59:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description "FeRD" (Frank Dana) 2025-11-30 11:22:40 UTC
With perl-JSON-PP-4.16-521.fc43.noarch, running any `json_pp` command produces a warning message: Duplicate specification "V" for option "v".

In addition, it will not accept its verbose option flag (-v), treating it the same as the version flag (-V)

Reproducible: Always

Steps to Reproduce:
1. json_pp --help
2.echo '{"one": 1}' | json_pp -v
Actual Results:
First command:

Duplicate specification "V" for option "v"
Unknown option: help
Usage: /usr/bin/json_pp [-V] [-f from_format] [-t to_format] [-json_opt options_to_json1[,options_to_json2[,...]]]

Second command:

Duplicate specification "V" for option "v"
4.16



Expected Results:
First command:

Unknown option: help
Usage: /usr/bin/json_pp [-V] [-f from_format] [-t to_format] [-json_opt options_to_json1[,options_to_json2[,...]]]

Second command:

{
   "one" : 1
}

(possibly with verbose processing messages included)


Additional Information:
The issue occurs because JSON::PP uses Perl Getopt::Long, which has an option 'ignore_case' which is default *enabled*. This option causes the option specs for 'v' (verbose) and 'V' (version) to be interpreted the same, and for the version spec to override the previous verbose spec.

Getopt::Long can be made case-sensitive by passing the configuration option 'no_ignore_case' when importing the module.

Changing the 'use' statement from:

use Getopt::Long;

to:

use Getopt::Long qw(:config no_ignore_case);

Will make the option processing case-sensitive, and restore processing of the verbose (-v) flag as separate from the version (-V) flag. (Note that JSON::PP doesn't appear to _have_ any verbose output, and never actually checks the `$opt_verbose` flag even if set, so in practical terms this change has no effect except to disable a warning message.)

This change was already made upstream via PR 93 (https://github.com/makamaka/JSON-PP/pull/93), in this commit:
https://github.com/makamaka/JSON-PP/commit/7052740e158491666e4f27d75241617a16170102

Comment 1 "FeRD" (Frank Dana) 2025-11-30 11:38:21 UTC
I've opened PR #1 in the package source repo, to apply upstream commit 7052740e as a patch.
https://src.fedoraproject.org/rpms/perl-JSON-PP/pull-request/1

Comment 2 Fedora Update System 2025-12-23 16:54:36 UTC
FEDORA-2025-39ff4e69af (perl-JSON-PP-4.16-522.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-39ff4e69af

Comment 3 Fedora Update System 2025-12-23 16:59:23 UTC
FEDORA-2025-39ff4e69af (perl-JSON-PP-4.16-522.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Fedora Update System 2025-12-23 17:12:33 UTC
FEDORA-2025-3a07257228 (perl-JSON-PP-4.16-522.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-3a07257228

Comment 5 Fedora Update System 2025-12-24 01:10:22 UTC
FEDORA-2025-3a07257228 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-3a07257228`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-3a07257228

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2025-12-25 00:53:07 UTC
FEDORA-2025-3a07257228 (perl-JSON-PP-4.16-522.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.