use line buffering (no buffering throws a ValueError on BB10, works fine on Android)