Instapy: Encoding error

Created on 7 Apr 2017  Â·  8Comments  Â·  Source: timgrossmann/InstaPy

UnicodeEncodeError: 'ascii' codec can't encode character u'u2026' in position 119: ordinal not in range(128) for some links

--> Image Liked!
Traceback (most recent call last):
  File "./quickstart.py", line 19, in <module>
    .like_by_tags(['#dog', '#messi', '#cr7', 'top'], amount=100) \
  File "/home/synod/AT/cronos/InstaPy/instapy/instapy.py", line 271, in like_by_tags
    print('Invalid Page: ' + str(err))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 119: ordinal not in range(128)

Most helpful comment

This is probably because of the encoding of the console you are using. To set for example Powershell to UTF-8, write the following in the console.

chcp 65001

Hope that works!

All 8 comments

This is probably because of the encoding of the console you are using. To set for example Powershell to UTF-8, write the following in the console.

chcp 65001

Hope that works!

This is a terminal encoding issue.
Follow below mentioned steps:

  1. Open CMD(for windows)
  2. Open directory (cd InstaPy)
  3. Command: set PYTHONIOENCODING=UTF-8
  4. Execute this command every time before running python script.

Hope this works!

Hi @hariom282538,

when I use your solution under CentOS, Chrome crashes immediately when the script starts.
Do you know any other solution?

Kind regards

Tibor

Please share screenshot.

On Sun, Apr 23, 2017 at 12:15 AM, Tibor Martini notifications@github.com
wrote:

Hi @hariom282538 https://github.com/hariom282538,

when I use your solution under CentOS, Chrome crashes immediately when the
script starts.
Do you know any other solution?

Kind regards

Tibor

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/45#issuecomment-296393433,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALVaWOXtlJEy6xJykLBjb3b4eriHXkVyks5rykrngaJpZM4M2xjt
.

Hi,

attached you can find the screenshot:

img_0571

Hey @tibor ,

First of all,This is not an encoding issue and i request my friend @timgrossmann to look into this matter. Meanwhile you can check log here
"chromedriver.log"
.
Please execute with super user and have a look "
http://stackoverflow.com/questions/23653461/chrome-failed-to-start-on-centos-using-chromedriver2-9
".

Thanks,
Hariom Vashisth

On Sun, Apr 23, 2017 at 12:36 AM, Tibor Martini notifications@github.com
wrote:

Hi,

attached you can find the screenshot:

[image: img_0571]
https://cloud.githubusercontent.com/assets/3136416/25307322/6b927a3c-279f-11e7-906c-6dd978903bf1.PNG

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/45#issuecomment-296394634,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALVaWNWHx0AreWKHpmEZgXnNIb41aDJ5ks5ryk-ZgaJpZM4M2xjt
.

@tibor probably too low on RAM 😉

Just add these lines to quickstart.py and instapy.py:

# -*- coding: UTF-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

CodeMaster1 picture CodeMaster1  Â·  3Comments

46960 picture 46960  Â·  3Comments

converge picture converge  Â·  3Comments

thisishotdog picture thisishotdog  Â·  3Comments

ingorichter picture ingorichter  Â·  3Comments