Skip to content

_read_geodataframe raises UnboundLocalError when the file cannot be read #1693

Description

@rajeeja
  • _read_geodataframe catches every read failure, prints it, and falls through, so gdf is never bound and the next line raises UnboundLocalError instead of the real cause.
  • Reproduced by reading any shapefile or GeoJSON without pyogrio/fiona installed; the actual message ("requires the 'pyogrio' or 'fiona' package") only reaches stdout.
  • Applies to any read failure: bad path, corrupt file, or missing driver all produce the same misleading error.
  • Fixed in Raise the underlying cause when geospatial data cannot be read #1694 by removing the try/except entirely, letting geopandas raise its own exception directly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions