curr.execute(
    """
    SELECT fields.fieldkey
    FROM fields
    LEFT JOIN zone ON zone.fieldkey=fields.fieldkey
    WHERE zone.zonekey = %s;
"""
    , (lines[0],))
PostgreSQL TypeError: not all arguments converted during string formatting