ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.69k stars 1.47k forks source link

Repost Best Photo Unicode Error #320

Closed Killerherts closed 6 years ago

Killerherts commented 7 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Purpose of your issue?


The following sections requests more details for particular types of issues, you can remove any section (the contents between the triple ---) not applicable to your issue.


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here:

Code:

bot.login()

users = None
if args.users:
    users = args.users
elif args.file:
    users = read_list_from_file(args.file)

repost_best_photos(bot, users, args.amount)

Error/Debug Log:


  File "repost_best_photos_from_users.py", line 93, in <module>
    repost_best_photos(bot, users, 5)
  File "repost_best_photos_from_users.py", line 27, in repost_best_photos
    repost_photo(my_bot, media)
  File "repost_best_photos_from_users.py", line 69, in repost_photo
    text = ''.join(f.readlines())
  File "C:\Users\killerherts\AppData\Local\Programs\Python\Python36-32\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 0x8d in position 3: character maps to <undefined>
2017-08-31 18:05:12,323 - INFO - Bot stopped. Worked: 0:00:12.290358
2017-08-31 18:05:12,323 - INFO - Total requests: 19```

---

### Describe your issue
I am attempting to use the repost best photo from user but I am getting this error. I saw a closed topic that said try python 3 I did that still no luck.
Killerherts commented 7 years ago

I have tried adding locale.getdefaultlocale = (lambda *args: ['en_US', 'utf8']) this does not seem to effect much


Traceback (most recent call last):
  File "C:\Users\killerherts\Documents\instabot\examples\repost_best_photos_from_users.py", line 93, in <module>
    repost_best_photos(bot, users, args.amount)
  File "C:\Users\killerherts\Documents\instabot\examples\repost_best_photos_from_users.py", line 27, in repost_best_photos
    repost_photo(my_bot, media)
  File "C:\Users\killerherts\Documents\instabot\examples\repost_best_photos_from_users.py", line 69, in repost_photo
    text = ''.join(f.readlines())
  File "C:\Users\killerherts\AppData\Local\Programs\Python\Python36-32\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 0x8d in position 3: character maps to <undefined>
>>>```
stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.