with open('README.md', 'r', encoding='utf-8') as f: content = f.read() # Replace the mangled ?? with the rocket emoji content = content.replace('emoji: ??', 'emoji: ??') with open('README.md', 'w', encoding='utf-8') as f: f.write(content)