In cypari2 2.1.3, the code
from cypari2.pari_instance import Pari
pari = Pari()
M = pari('nfinit(x^2 + 1)')
P = M.idealfactor(7)[0, 0]
G = M.galoisinit()
print(G[5]) # error does not arise without this line
print(M.idealfrobenius(G, P))
raises SystemError: new_gen() argument not on PARI stack, not on PARI heap and not a universal constant
Possibly related: #133