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

Invalid input #8

Open
liukliukliuk opened this issue Mar 14, 2021 · 3 comments
Open

Invalid input #8

liukliukliuk opened this issue Mar 14, 2021 · 3 comments
Assignees

Comments

@liukliukliuk
Copy link

image

This keeps happening even though I choose valid locations or just enter.

@aprikyan aprikyan self-assigned this Mar 15, 2021
@isra00
Copy link

isra00 commented Mar 22, 2021

Same problem here. I have found out that the problem occurs for books whose title contains characters that are invalid for filenames, e.g. a semicolon (which is pretty common in books with a subtitle). The path (new_directory) in step3() should be filtered taking into account the illegal characters in different filesystems (I guess NTFS is the most restrictive). Additionally, error handling might be improved by distinguishing "Bad input" errors from "filesystem errors".

@Eddict
Copy link

Eddict commented Apr 17, 2021

i solved it like this;

def clean_path(path):
    invalid = '<>:"/\|?* '

    for char in invalid:
        path = path.replace(char, '')

    return path
      new_directory = os.path.join(main_directory, clean_path(book_data))

also in save_backup()

@isra00
Copy link

isra00 commented May 26, 2021

@Eddict that's great! Could you make it in a pull request so that code can go to upstream? Thank you

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

4 participants