AThePeanut4 / docify

A script to add docstrings to Python type stubs using reflection
MIT License
5 stars 2 forks source link

Always use UTF-8 encoding for text file IO #4

Closed jfcherng closed 1 week ago

jfcherng commented 1 week ago

Fixes the following error:

INFO: processing ftplib.pyi
  9%|███████▎                                                                         | 51/566 [00:04<00:47, 10.78it/s]
Traceback (most recent call last):
  File "D:\Repo\docify\docify.py", line 667, in <module>
    main(*sys.argv[1:])
  File "D:\Repo\docify\docify.py", line 663, in main
    run(**run_args)
  File "D:\Repo\docify\docify.py", line 606, in run
    f.write(new_stub_cst.code)
UnicodeEncodeError: 'cp950' codec can't encode character '\xb4' in position 2140: illegal multibyte sequence
AThePeanut4 commented 1 week ago

Can you tell I don't use Windows 🤣

Thanks!