Skip to content

Layout.get_info segfaults on invalid index (python 3.11 module) #1464

Closed
@sebastian-goeldi

Description

@sebastian-goeldi

If an invalid/non-existent layer index is passed to Layout.get_info(index) klayout segfaults. I would expect it to handle it a bit more graceful, either return None (python case) or throw an exception.

Test case:

>>> import klayout.db as kdb
>>> kdb.__version__
'0.28.11'
>>> ly = kdb.Layout()
>>> layer = ly.layer(1,0)
>>> linfo_valid = ly.get_info(layer)
>>> layer
0
>>> ly.get_info(1)
Segmentation fault (core dumped)

I know this is not a common case, but it should still not seg fault ;).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions