markowanga / stweet

Advanced python library to scrap Twitter (tweets, users) from unofficial API
MIT License
581 stars 67 forks source link

Installing using setup.py on Windows fails with UnicodeDecodeError #58

Closed chillerno1 closed 2 years ago

chillerno1 commented 3 years ago

I encountered a minor issue after cloning the repo and attempting to install the package through python -m setup.py install.

(venv) C:\Users\Profile\PycharmProjects\stweet>python -m setup.py install
Traceback (most recent call last):
  File "C:\Users\Profile\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Users\Profile\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\Profile\PycharmProjects\stweet\setup.py", line 4, in <module>
    LONG_DESCRIPTION = fh.read()
  File "C:\Users\Profile\AppData\Local\Programs\Python\Python37\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 2176: character maps to <undefined>

Will submit a PR shortly linked to this issue # with an update to setup.py so that encoding='utf-8' is explicitly defined in the read blocks.

Edit: grammar*

markowanga commented 3 years ago

Hi, I will check it Today, thank you for your PR, I have macOS and Linux installed :D

markowanga commented 2 years ago

Now project is on poetry :D