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

OSError: [Errno 36] File name too long #72

Open
ahxxm opened this issue May 4, 2024 · 1 comment
Open

OSError: [Errno 36] File name too long #72

ahxxm opened this issue May 4, 2024 · 1 comment

Comments

@ahxxm
Copy link

ahxxm commented May 4, 2024

Problem and Reproduce

In rare cases, e.g. Lonely Planet series, there might be more than 10 authors, making the filename exceed limit of ext4

Lonely Planet Great Britain - Kerry Walker, Lauren Keith, Emily Luxton, Hugh McNaughtan, Lorna Parkes, Joseph Reaney, Tasmin Waby, Neil Wilson, Isabel Albiston, Oliver Berry, Joe Bindloss, Keith Drew, Dan Fahey, Kay Gillespie, Laurie Goodlad, Sarah Irving.epub

Version/Environment

latest master, regular linux

Workaround

In extract_authors_from_openbook, remove the last ones by

def extract_authors_from_openbook(openbook: Dict) -> List[str]:
    """
    Extract list of author names from openbook

    :param openbook:
    :return:
    """
    creators = [
        c["name"]
        for c in openbook.get("creator", []) if c.get("role", "") in {"author", "editor"}
    ]
    while len(", ".join(creators)) > 100:  # 100 is arbitrary
        creators.pop()
    return creators
@joshuatly
Copy link

There is also --bookfileformat and --bookfolderformat which can help with the rare case

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

2 participants