-
Notifications
You must be signed in to change notification settings - Fork 366
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
Problem with temporary directory in Windows OS #70
Comments
As far as I know, Python What was the error? Can you try changing def create_path(path):
path = os.path.join('', path)
if not os.path.exists(path):
os.makedirs(path)
return path |
The error is (for each book that needs the 'tmp'): Unfortunatelly I made a mistake with the first workaround and I finished with subdirs with the name of the books with the book inside with name "-temp_file-.bak". Due I supposed book_path was only the book path without including the book name. With this _download_book tunned function I have downloaded all the books in my Win 10 Spanish (but I have not tested it in other OS's:
I have used the os.path functions join and split to create a tmp folder inside each book genre and I removed it (each time a book is downloaded... I know is not very optimized) with rmtree from shutil |
I forget to comment that I tried firstly your tunned function create_path but I have found the same "[WinError 123] " than with the original one. |
Inside helper.py the subfolder "./tmp" is not welcomed in my Windows 10
I have replaced the line path = create_path('tmp')
with path = create_path(os.path.join(book_path, 'tmp'))
I have added also a shutil.rmtree(os.path.join(book_path, 'tmp'))
at the end of the _download_book(url, book_path) function
I made the workaraound without inspecting the whole code. But it is working fine now in my Windows machine. I thinks it is also compatible with other OS's as I have used os.path.join without the os.path.sep, but I have not tested it.
The text was updated successfully, but these errors were encountered: