Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected nonzero return code from .py utilities with --help or --version #8717

Closed
plimkilde opened this issue Nov 15, 2023 · 0 comments
Closed
Assignees

Comments

@plimkilde
Copy link
Contributor

Expected behavior and actual behavior.

Some of the .py utilities of GDAL (gdalattachpct.py, gdal_sieve.py etc.) return a nonzero code when called with --help and/or --version. This is rather problematic in CI, see conda-forge/gdal-feedstock#835 and conda-forge/gdal-feedstock#853.

Some of these utilities were fixed in #8676, but a few still have issues. I've systematically tested GDAL 3.8.0 with the results below:

Command With --help With --version
rgb2pct.py 0 0
pct2rgb.py 0 0
gdalattachpct.py 2 2
gdal_merge.py 0 0
gdal2tiles.py 0 0
gdal2xyz.py 0 0
gdal_retile.py 0 0
gdal_proximity.py 0 0
gdal_polygonize.py 0 0
gdal_sieve.py 2 0
gdal_fillnodata.py 0 0
gdalmove.py 2 0
gdal_edit.py 0 0
gdal_calc.py 0 0
gdal_pansharpen.py 0 0
gdalcompare.py 2 0
ogrmerge.py 0 0
ogr_layer_algebra.py 0 0

Steps to reproduce the problem.

Call
NAME_OF_THE_UTILITY.py --help
or
NAME_OF_THE_UTILITY.py --version
and check the return value.

Operating system

Tested on Windows 10, x86-64, but is probably cross-platform.

GDAL version and provenance

Tested with GDAL 3.8.0 from conda-forge, build py312hb5f3cee_1.

@rouault rouault self-assigned this Nov 15, 2023
rouault added a commit to rouault/gdal that referenced this issue Nov 15, 2023
rouault added a commit to rouault/gdal that referenced this issue Nov 15, 2023
rouault added a commit that referenced this issue Nov 16, 2023
gdal_sieve.py/gdalattachpct.py/gdalcompare.py/gdalmove.py: make sure --version and --help return 0 error code (fixes #8717)
rouault added a commit that referenced this issue Nov 16, 2023
…--version and --help return 0 error code (fixes #8717)
rouault added a commit that referenced this issue Nov 17, 2023
[Backport release/3.8] gdal_sieve.py/gdalattachpct.py/gdalcompare.py/gdalmove.py: make sure --version and --help return 0 error code (fixes #8717)
ralphraul pushed a commit to 1SpatialGroupLtd/gdal that referenced this issue Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants