Skip to content

Pymca main window: avoid pop-up on broken link #1111

@woutdenolf

Description

@woutdenolf
import h5py

with h5py.File("test.h5", track_order=True, mode="w") as fh:
    i = 1
    entry = fh.create_group(f"1.{i}")
    entry["instrument/detector/data"] = [1, 2, 3]
    entry["measurement/data"] = h5py.SoftLink(f"/1.{i}/instrument/detector/data")

    i = 2
    entry = fh.create_group(f"1.{i}")
    entry["measurement/data"] = h5py.SoftLink(f"/1.{i}/instrument/detector/data")

A dialog pops up with

'NoneType' object has no attribute '_posixPath'   File "/home/denolf/dev/pymca/src/PyMca5/PyMcaGui/io/hdf5/HDF5Widget.py", line 562, in rowCount
    return len(self.getProxyFromIndex(index))
  File "/home/denolf/dev/pymca/src/PyMca5/PyMcaGui/io/hdf5/HDF5Widget.py", line 354, in __len__
    return len(self.children)
  File "/home/denolf/dev/pymca/src/PyMca5/PyMcaGui/io/hdf5/HDF5Widget.py", line 207, in children
    finalList[i][1]._posixPath = posixpath.join(self.name,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions