I am creating a script that uses 

python 3.7.3  
pyserial 3.4 
pytest 5.4.2

The scripts run on a windows 10 machines that  communicates with another device. On some occasions I see that the string I pass into serial module write method is either  transmitted with a character missing or on rare occasions with one of the characters substituted. I have checked the baud rate to make sure the windows machine and the device are using the same baud rate, and have found the baud rates and all other serial port settings to be the same.
I have drilled into the pyserial module into the file serialwin32.py in the write method. I can see that the string I pass in definitely is passed into this function.
When I use Teraterm on the windows machine I do not incur this problem.
Also when I run the same python scripts on an ubuntu machine the problem does not occur.
Any help on where the issue may be will be appreciated.
What baud rate are you using? Can it be increased? If not and it works on TeraTerm but not in Python, as you noted, it could be a flow control issue that is resolved by having your code mirror the flow control used in TeraTerm. If none of that pans out, could you describe in more detail the test you are doing in TeraTerm? When using TeraTerm, are you typing in the data or pasting it? Make sure to try pasting data (or maybe create a TeraTerm macro) that really hammers data through the interface so that you can be sure that TeraTerm really is working and not masking the same issue as the script.
Python Serial Port omitting characters in transmission