Rename non-active material

Is it possible to rename a material that is not assigned to an object?

I’m doing this atm to import materials, but the new materials name ends up with a suffix instead of replacing the old one by the same name:

matPath = “C:/simplemat.blend”
with, link=False) as (data_src, data_dst):
data_dst.materials = [data_src.materials[0]][].name ??

Check out name panel, it will let you fix the counting issue for the materials. link in my signature.