Downgrading to mysql-connector-python 9.0.0 seemed to fix this for me.
mysql-connector-python
I was having the same issue. In your example, my code would print A, B, and then exit before hitting C. Running the loggers Marcin mentioned would not give me any output.