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 <pieter.roggemans@gmail.com>
@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)

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