with open('src/order_executor.py', 'r', encoding='utf-8') as f: content = f.read() # Fix the logger line that's missing indentation (after my edit it lost its leading spaces) target = "logger.info(f\"Attempt {attempt}: placing ${order_size * order_price:.2f} @ {order_price:.2f} cap\")" correct = " " + target # Replace the unindented version with the indented one if target in content and correct not in content: # Find the unindented occurrence content = content.replace(target, correct, 1) with open('src/order_executor.py', 'w', encoding='utf-8') as f: f.write(content) print("Fixed indentation") else: print("Already correct or not found") if target in content: print(" target found, correct also found:", correct in content) else: print(" target not found")