Skip to content

Empty Exception for each open_rasterio call #929

@djmallum

Description

@djmallum

I searched and was unable to find anyone else reporting this issue.

Code Sample

Here is my minimum working example

import numpy as np
import xarray as xr
import rioxarray as rio

y = np.linspace(40, 45, 10)
x = np.linspace(-75, -70, 10)

da = xr.DataArray(
    np.full((10, 10), np.nan),
    dims=['y', 'x'],
    coords={'y': y, 'x': x}
)

da.rio.write_crs('EPSG:4326') \
   .rio.set_spatial_dims(x_dim='x', y_dim='y') \
   .rio.to_raster('geo_grid.tif')

for i in range(1,100):
    loaded = rio.open_rasterio('geo_grid.tif')

Problem description

So in this case, after any exceptions (in the above there are none) or errors, 100 copies of the following are printed:

Error in sys.excepthook:

Original exception was:

Exactly as is, no additional detail. Whitespace is consistent.

Expected Output

Nothing.

Environment Information

With personal information censored/removed:

% python -c "import rioxarray; rioxarray.show_versions()"
rioxarray (0.22.0) deps:
  rasterio: 1.5.0
    xarray: 2026.4.0
      GDAL: 3.12.1
      GEOS: 0.0.0
      PROJ: 9.7.1

Other python deps:
     scipy: None
    pyproj: 3.7.2

System:
    python: 3.13.5 [Clang 17.0.0 (clang-1700.0.13.3)]
   machine: macOS-26.5.1

Installation method

Installed with pip in a venv.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions