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

[BUG] Failed to save checkpoint when change base_path #1289

Open leandromqrs opened 4 years ago

leandromqrs commented 4 years ago

Example file

If you ran an example file specify it here.

Describe the bug

When I change the current path of base_path to a custom base_path, the program when finish and close fail to save the checkpoint file.

Log

2020-02-13 02:02:17,678 - DEBUG - Saving Checkpoint file to: /home/computer/works/Ungram/config/obatmanqueri.checkpoint
 Error in atexit._run_exitfuncs:
 Traceback (most recent call last):
   File "/usr/lib/python3.8/site-packages/instabot/bot/bot.py", line 467, in print_counters
     save_checkpoint(self)
   File "/usr/lib/python3.8/site-packages/instabot/bot/bot_checkpoint.py", line 50, in save_checkpoint
     with open(fname, "wb") as f:
 FileNotFoundError: [Errno 2] No such file or directory: '/home/computer/works/Ungram/config/obatmanqueri.checkpoint'

To Reproduce

(EXAMPLE:) Steps to reproduce the behavior:

  1. Run anyone instabot script with custom base_path
  2. Finish the script and wait for the error

Expected behavior

The expected is to save normally in the custom base_path.

Additional context

Add any other context about the problem here.

Version

Python version (python -v): 3.8 OS: Linux

duplicate-issues[bot] commented 4 years ago

Hey @leandromqrs,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job :smile:

If not, the maintainers will get to this issue shortly.

Cheers, Your Friendly Neighborhood ProBot

bruvv commented 4 years ago

Make sure there is a config path in your running folder.

leandromqrs commented 4 years ago

Yeah but i need to save in other location, all others files from instabot is saving to "data" folder, i put in the base_path for this, only the checkpoint saving in "config" folder, why?? The previous version works correctly

adw0rd commented 4 years ago

I have the same problem, I pass base_path, but it's replaced when join paths (base_path + CHECKPOINT_PATH). Previously, only the file name was stored in CHECKPOINT_PATH, now there is the full path, this is the problem