python3 input function not returning after hitting enter?

I have a program written in python 3.8.6 that calls the input function, like so

device_name = input(f"Please enter a name for device {device}: ")

However, when the code gets to this point, it simply does not return from the input function and the user provided device name does not ever print.

In this particular program, I am also using serial library to communicate with serial devices and I have noticed that printing in general is also delayed, I think due to the use of this library and interacting with serial devices. I am wondering if this is interfering with input as well. I have tried to close the serial device with ser.close() before calling the input function but so far, this does not seem to have helped.

Any suggestions on how to force user input being accepted when hitting enter is welcome, thanks.