'Pygame event.unicode not handling ^ (caret) correctly

I have a Textbox, where the player enter something as input, but when he enters ^ the next character typed also turns into ^. My code for getting the players input:

if event.type == pygame.KEYDOWN:
    if event.key == pygame.K_ESCAPE:
        box_active = False
if user_text == "Invalid Input":
    user_text = ""
    pt_list = []
    coord_list = []
if box_active:
    if event.key == pygame.K_BACKSPACE:
        user_text = user_text[:-1]
        pt_list = []
        coord_list = []
        draw = False
    elif event.key == pygame.K_RETURN:
        draw = True

    else:
        user_text += event.unicode
        pt_list = []
        coord_list = []

I then draw the user_text onto the screen.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source