Skip to content

Conversation

m-richards
Copy link
Member

@m-richards m-richards commented Aug 17, 2025

This was user error, I was trying to do more or less this

layers = pyogrio.list_layers(...)
infos = [pyogrio.read_info(file, layer) for layer in layers]

forgetting that layers doesn't return a list of strings.

Here's a minimal reproducer:

import pyogrio
import geodatasets
pyogrio.read_info(geodatasets.get_path("nybb"), layer=['test']) # segfaults because layer is not a str

Still think it's worth this giving a proper error message though.

Copy link
Member

@theroggy theroggy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Just a small indentation suggestion...

Co-authored-by: Pieter Roggemans <[email protected]>
@theroggy theroggy added this to the 0.11.0 milestone Aug 27, 2025
@theroggy theroggy changed the title Fix segfault on giving incorrect type to read_info layer BUG: fix segfault on giving incorrect type to read_info layer Aug 27, 2025
@theroggy theroggy modified the milestones: 0.11.0, 0.12.0 Aug 27, 2025
Copy link
Member

@brendan-ward brendan-ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @m-richards ! Can you please add a changelog entry for 0.12? (merge from main first)

@theroggy theroggy merged commit 51b69e4 into geopandas:main Aug 31, 2025
25 checks passed
@m-richards m-richards deleted the read_info_segfault branch August 31, 2025 12:08
@m-richards
Copy link
Member Author

Thanks @m-richards ! Can you please add a changelog entry for 0.12? (merge from main first)

Added, wasn't sure if this was too niche for a changelog entry.

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

Successfully merging this pull request may close these issues.

3 participants