Public bug reported:

When using the GDAL python API (package pyhon3-gdal), attempting to access the 
data type of a loaded raster's band (via the property DataType) throws the 
exception: 
"in method 'Band_DataType_get', argument 1 of type 'GDALRasterBandShadow *'"

The issue was limited (in my case) to Ubuntu 24.04. Discovered on a
month-old installation, and reproduced on a second machine using the
Ubuntu live (running from a thumb drive) environment with freshly
fetched packages (version 3.8.4+dfsg-3ubuntu3).

When running the same test code on an Ubuntu 22.04 installation (latest
available python3-gdal version is 3.4.1+dfsg-1build4) for the same
raster, it produces the correct output without throwing any exceptions.


A simple python code to test this:
---------------------------------------------------------------------------------------------------
from osgeo import gdal
from osgeo.gdalconst import GA_ReadOnly

try:
    rasterDataType = gdal.Open("/path/to/some/raster", 
GA_ReadOnly).GetRasterBand(1).DataType
except Exception as e:
    print(e)
---------------------------------------------------------------------------------------------------


Several datasets were used in testing. e.g. Landast 8 Collection 2 Level 2 
rasters, obtained from https://earthexplorer.usgs.gov


(P.S: This is my first ever bug report. Would appreciate the patience and 
advice regarding any mistakes or missing information. This report was initiated 
using ubuntu-bug, unless I misunderstood the process, it collects and includes 
all the relevant version/package information)

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: python3-gdal 3.8.4+dfsg-3ubuntu3
ProcVersionSignature: Ubuntu 6.8.0-35.35-generic 6.8.4
Uname: Linux 6.8.0-35-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Jun 22 17:59:05 2024
InstallationDate: Installed on 2024-06-01 (21 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
SourcePackage: gdal
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gdal (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug gdal noble third-party-packages

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2070102

Title:
  Accessing DataType of a loaded band throws an exception

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdal/+bug/2070102/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to