Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no such file or directory : 'backup/SEARCH', error "atexit._run" and "sys.exitfunc" #4

Open
ghost opened this issue Mar 21, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 21, 2019

Hi! It all works perfectly, but when it comes to end, this error appear.
How can I overcome this?

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Users/g4ryh0st/Desktop/500px-bot-master/init.py", line 59, in store_all_and_logout
botClass.store_queue()
File "/Users/g4ryh0st/Desktop/500px-bot-master/lib/bot/bot.py", line 202, in store_queue
with open("backup/"+filename, mode='w') as backup:
IOError: [Errno 2] No such file or directory: 'backup/SEARCH'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Users/g4ryh0st/Desktop/500px-bot-master/init.py", line 59, in store_all_and_logout
botClass.store_queue()
File "/Users/g4ryh0st/Desktop/500px-bot-master/lib/bot/bot.py", line 202, in store_queue
with open("backup/"+filename, mode='w') as backup:
IOError: [Errno 2] No such file or directory: 'backup/SEARCH'

@TheJoin95
Copy link
Owner

Thank you for submitting this issue.

The problem seems to be that the script don't have the permission to create the backup/SEARCH folder/file.

Can you please create that folder? So it can works without any problem,

let me know
thank you

@ghost
Copy link
Author

ghost commented Mar 21, 2019

(https://user-images.githubusercontent.com/48792586/54779741-38f4bc80-4c18-11e9-8c8c-2a902792b412.png)

I tried, but I obtain this:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Users/g4ryh0st/Desktop/500px-bot-master/init.py", line 59, in store_all_and_logout
botClass.store_queue()
File "/Users/g4ryh0st/Desktop/500px-bot-master/lib/bot/bot.py", line 202, in store_queue
with open("backup/"+filename, mode='w') as backup:
IOError: [Errno 2] No such file or directory: 'backup/SEARCH'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Users/g4ryh0st/Desktop/500px-bot-master/init.py", line 59, in store_all_and_logout
botClass.store_queue()
File "/Users/g4ryh0st/Desktop/500px-bot-master/lib/bot/bot.py", line 202, in store_queue
with open("backup/"+filename, mode='w') as backup:
IOError: [Errno 2] No such file or directory: 'backup/SEARCH'

@TheJoin95
Copy link
Owner

Ok, so can you please edit the file lib/bot/bot.py at this line:
with open("backup/"+filename, mode='w')

Change "backup/" to your full project path like "/Documents/Username/backup/".
Thank you

@ghost
Copy link
Author

ghost commented Mar 21, 2019

Ok now I got this:

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Users/g4ryh0st/Desktop/500px-bot-master/init.py", line 59, in store_all_and_logout
botClass.store_queue()
File "/Users/g4ryh0st/Desktop/500px-bot-master/lib/bot/bot.py", line 203, in store_queue
json.dump(self.constants[queueKey].queue, backup)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 189, in dump
for chunk in iterable:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 442, in _iterencode
o = _default(o)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: deque([]) is not JSON serializable
Error in sys.exitfunc:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Users/g4ryh0st/Desktop/500px-bot-master/init.py", line 59, in store_all_and_logout
botClass.store_queue()
File "/Users/g4ryh0st/Desktop/500px-bot-master/lib/bot/bot.py", line 203, in store_queue
json.dump(self.constants[queueKey].queue, backup)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 189, in dump
for chunk in iterable:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 442, in _iterencode
o = _default(o)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: deque([]) is not JSON serializable

@TheJoin95
Copy link
Owner

Ok, it seems correct now.
Of course if it is an empty list it will not work

@ghost
Copy link
Author

ghost commented Mar 21, 2019

Sorry, can you explain me which list? Ahaha
Btw thank you so much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant