daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
75 stars 22 forks source link

OPF manifest item href with percent-encoded URL results in filepath failure #290

Closed gregoriopellegrino closed 4 years ago

gregoriopellegrino commented 5 years ago

Please provide the following details if possible or relevant:

I downloaded an EPUB 2, launched the DAISY app, selected it for checking, but I get no results.

In the log I see:

Running Ace on /Users/uu/Downloads/Test ebook.epub
[object Object]

I can send you the file privately.

danielweck commented 5 years ago

Thank you for the report! Do you get the same result with Ace CLI?

danielweck commented 5 years ago

PS: I moved this issue to the Ace GUI repository, as per your issue description.

danielweck commented 5 years ago

Could you please share (privately) the EPUB file with me daniel.weck@gmail.com Thanks!

gregoriopellegrino commented 5 years ago

On Ace CLI I get

info:    Processing /Users/uu/Downloads/Test ebook.epub
info:    Parsing EPUB
error:   Failed to parse EPUB
error:   Unexpected error: ENOENT: no such file or directory, open '/var/folders/p3/k6l3_3qn7sjdlzshshj4dg2h0000gn/T/tmp-1126u0hnbQ4MurYI/OEBPS/Senza%20titolo-1.xhtml'
info:    Closing logs.
danielweck commented 5 years ago

Immediately I see that the space character in the filename is escaped for URL usage (%20), so perhaps this is the cause.

gregoriopellegrino commented 5 years ago

I think the same, but it is possible in EPUBs, is it?

The EPUBcheck reports warnings about filenames with spaces, but no errors.

danielweck commented 4 years ago

I am able to reproduce this bug in the latest "beta" Ace CLI ( https://www.npmjs.com/package/@daisy/ace/v/1.2.0-beta.4 ) from this PR / branch https://github.com/daisy/ace/pull/236 This is definitely an issue related to URL escaping / percent-encoding. I am looking into it.

danielweck commented 4 years ago

The latest "beta" version (1.2.0-beta.4) of Ace includes a fix for this issue (i.e. proper handling of URL percent-encoding and HTML URL escaping on all ZIP resources, including support for non-ASCII chars in file names).

@gregoriopellegrino I tested the fix with your publication Zenaro esercitazione ebook.epub You may try this yourself by installing Ace "beta" from the next NPM release channel: npm install --global @daisy/ace@next (alternatively, you may remove --global to install the Ace packages locally, inside a folder-contained NPM project)

Notes to developers: https://www.npmjs.com/package/@daisy/ace/v/1.2.0-beta.4 ... is built from the codebase in this PR / branch https://github.com/daisy/ace/pull/236

Git commit: https://github.com/daisy/ace/commit/009142f560cff59bb860c54c03d3a559807d4113

New unit test: https://github.com/daisy/ace/commit/0d143bb7d8d6d7f77c2eefb3c3f2c08eb5e89b79

gregoriopellegrino commented 4 years ago

It works great, thanks!