I know nothing about hyperelliptic curves. From the code, it seems possible that `self._names` is not taken into account properly.
In jacobian_morphism.py, we have
class JacobianMorphism_divisor_class_field(AdditiveGroupElement, SchemeMorphism):
[...]
def __init__(self, parent, polys, check=True):
[...]
f, h = C.hyperelliptic_polynomials()
a, b = polys
if not (b**2 + h*b - f) % a == 0:
and in your case, C.hyperelliptic_polynomials() gives
sage: C.hyperelliptic_polynomials()
(u^5 + u + 23, 0)
However, the caller JacobianHomset_divisor_classes.__call__ in jacobian_homset.py does the follwing:
def __call__(self, P):
[...]
R = PolynomialRing(self.value_ring(), 'x')
P1 = R(P1)
P2 = R(P2)
return JacobianMorphism_divisor_class_field(self, (P1, P2))
i.e., it converts your input to polynomials in `x`. So that cannot work.
Martin