Python: inserting components causes diacritic display problem

Given: Two-master font with Light and Bold, finished A, finished dieresis (all anchors set) and an empty Adieresis.

This script appears to insert a Bold “A” in the Light Adieresis (sometimes vice versa). Saving, closing and re-opening the file fixes the (display) problem. Is there a way to avoid this problem?

baseComponent = GSComponent( “A” )
Glyphs.font.glyphs[“Adieresis”].layers[0].components.append( baseComponent )
Glyphs.font.glyphs[“Adieresis”].layers[1].components.append( baseComponent )

accentComponent = GSComponent( “dieresis” )
Glyphs.font.glyphs[“Adieresis”].layers[0].components.append( accentComponent )
Glyphs.font.glyphs[“Adieresis”].layers[1].components.append( accentComponent )

[tested in 1.3.17 and 1.3.19 (471) ]

You insert the same component object in both masters.
Do something like this:
baseComponent = GSComponent( “A” )
Glyphs.font.glyphs[“Adieresis”].layers[0].components.append( baseComponent )
baseComponent = GSComponent( “A” )
Glyphs.font.glyphs[“Adieresis”].layers[1].components.append( baseComponent )