Opened 14 years ago

Closed 14 years ago

#3269 closed defect (fixed)

Corrupt *.aux causes gdal.Open() to fail

Reported by: lpinner Owned by: hobu
Priority: normal Milestone: 1.8.0
Component: PythonBindings Version: 1.6.2
Severity: normal Keywords:
Cc:

Description

Attempting to open an ArcInfo GRID (via python bindings) that has a possibly? corrupt? .aux file fails. However, gdalinfo works (as does gdal_translate) but prints errors to stderr.

The obvious workaround is to simply move/delete/rename the suspect aux file, but that's not always possible (i.e. working in a read-only directory).

Another workaround is to cd into the grid directory and the open the 'hdr.adf' file (opening '.' works as well). However, the attribute table isn't read.

A small test script and dataset are attached.

Note:the dataset is a subset of the original which was slightly too big too attach to this trac ticket so I simply copied the suspect .aux file across. I'm not sure if this will be an issue, but my test script results are identical when run against the original and subset.

Attachments (1)

test.zip (56.1 KB ) - added by lpinner 14 years ago.
Test script and ArcInfo grid dataset

Download all attachments as: .zip

Change History (2)

by lpinner, 14 years ago

Attachment: test.zip added

Test script and ArcInfo grid dataset

comment:1 by Even Rouault, 14 years ago

Milestone: 1.8.0
Resolution: fixed
Status: newclosed

This is related to #1635 and r11529 that prevent Python from returning a dataset handle if a CE_Failure error was triggered during the GDALOpen() call.

r19588 /trunk/gdal/ (gcore/gdal_misc.cpp port/cpl_error.cpp port/cpl_error.h): Avoid a CE_Failure error triggered while trying to open auxiliary .aux file to prevent the main file from being opened from Python

Note: See TracTickets for help on using tickets.