Instapy: POW Error

Created on 1 Aug 2018  路  6Comments  路  Source: timgrossmann/InstaPy

Hello, i keep getting this error while following users of a follower or follow commenters of someones.

Pow! Error occured while dumping follow restriction data to a local JSON:
slices not implemented, yet

Any help ? thank you.

(I have last files)

wontfix

Most helpful comment

You're welcome @bianpratama
Yes you're so right about the source of the problem and I have produced a solution for it.
_Since slicing is not supported, let's use plain indexing [馃檪]_
To solve, open up in unfollow_util.py file, find dump_follow_restriction definition and replace,

follow_data = dict(user_data[1:3] for user_data in data or [])

with

follow_data = {user_data[1]: user_data[2] for user_data in data or []}

Actually, I used the prior solution to save some characters but anyways 馃榿

You should remove the raise line now

Cheers 馃ぉ

All 6 comments

I got that too 馃憜

ERROR [2018-08-01 18:23:02] [username]  Pow! Error occured while dumping follow restriction data to a local JSON:
        slices not implemented, yet

my quickstart file:

main.set_user_interact(amount=3, randomize=True, percentage=100, media='Photo')
main.set_do_follow(enabled=True, percentage=100, times=2)
main.like_by_tags(chosen_hashtags, amount=1, interact=True, media='Photo')

Python version: Python 2.7.13

Would like your help, @uluQulu? 馃檹

Thank you.

Alright,
Let's solve it!

@bianpratama, open up unfollow_util.py file and find dump_follow_restriction definition, and there, add raise after this line,

logger.error("Pow! Error occured while dumping follow restriction data to a local JSON:\n\t{}".format(str(exc).encode("utf-8")))
raise   ## ADD HERE

Then post the full troubleshoot information you get in console to find out the bug.

Thanks for the response, @uluQulu

I have added the raise. This is the console output:

ERROR [2018-08-01 20:04:58] [username]  Pow! Error occured while dumping follow restriction data to a local JSON:
    slices not implemented, yet
INFO [2018-08-01 20:04:58] [username]  Traceback (most recent call last):
  File "_username.py", line 33, in job
    bot.end()
  File "/Users/username/Sites/github/InstaPy/custom/custom.py", line 409, in end
    self.main.end()
  File "/Users/username/Sites/github/InstaPy/instapy/instapy.py", line 2724, in end
    dump_follow_restriction(self.username, self.logger, self.logfolder)
  File "/Users/username/Sites/github/InstaPy/instapy/unfollow_util.py", line 979, in dump_follow_restriction
    follow_data = dict(user_data[1:3] for user_data in data or [])
  File "/Users/username/Sites/github/InstaPy/instapy/unfollow_util.py", line 979, in <genexpr>
    follow_data = dict(user_data[1:3] for user_data in data or [])
ValueError: slices not implemented, yet

Please do ignore the bot.end() and self.main.end(). I called InstaPy class within my own custom class. But it should not affect this issue.

Update:
I encountered this error both on:

  • Raspberry Pi, Firefox, headless, nogui
  • Mac, Chrome, headless

Update:
I can confirm that this issue occurs when using Python 2.7.15. It doesn't occur when using Python 3.7.0. It relates with the added support of slicing for sqlite3.Row object in Python 3.5.

References:

@Edhim, are you using python 2.7.* too?

You're welcome @bianpratama
Yes you're so right about the source of the problem and I have produced a solution for it.
_Since slicing is not supported, let's use plain indexing [馃檪]_
To solve, open up in unfollow_util.py file, find dump_follow_restriction definition and replace,

follow_data = dict(user_data[1:3] for user_data in data or [])

with

follow_data = {user_data[1]: user_data[2] for user_data in data or []}

Actually, I used the prior solution to save some characters but anyways 馃榿

You should remove the raise line now

Cheers 馃ぉ

@bianpratama yes using 2.7

Thank you @uluQulu for solving it 馃憤 馃槂

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. > If this problem still occurs, please open a new issue

Was this page helpful?
0 / 5 - 0 ratings