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

false positives due to locale settings #711

Closed
haqer1 opened this issue Nov 6, 2016 · 7 comments
Closed

false positives due to locale settings #711

haqer1 opened this issue Nov 6, 2016 · 7 comments
Labels
type: bug The issue describes a bug
Milestone

Comments

@haqer1
Copy link
Contributor

haqer1 commented Nov 6, 2016

It seems epubcheck is not handling page-lists as
https://idpf.github.io/a11y-guidelines/content/nav/pagelist.html
says it should.
I get the following even though i don't think i should:
ERROR(OPF-027): OEBPS/nav.xhtml(91,41): Undefined property: 'page-list'.
ERROR(NAV-003): OEBPS/content.opf(-1,-1): The Navigation Document must have a page list when content document(s) contain page breaks (epub:type="pagebreak").

And all of the examples with page-lists that i've found (such as childrens-literature.epub) also fail with these kinds of errors. I even tried changing type to EDUPUB, but that doesn't improve things (& i think it shouldn't be required to have a page-list in EPUB3 anyway).

Strangely, idpf.org validation says no errors on the same epubs, & it says it also uses epubcheck 4.0.1.

@haqer1
Copy link
Contributor Author

haqer1 commented Nov 6, 2016

The following is my starter page-list (nav.xhtml):

            <nav epub:type="page-list" hidden="hidden"><!--  id="pages"-->
                     <h2>Pagebreaks of the print version, first edition</h2> 
                     <ol>
                                <li>
                                          <a href="title-page-i.xhtml#p01">1</a>
                                </li>
                                <li>
                                          <a href="title-page-ii.xhtml#p02">2</a>
                                </li>
                     </ol>
            </nav>

And the following is source (content.opf):

            <dc:source id="src">http://www.ebay.com/itm/ULKULERiM-/122208566685?hash=item1c7432bd9d:g:tOIAAOSwHMJYGO6N</dc:source>
                <meta property="source-of" refines="#src">pagination</meta>

And the following is a sample page break (title-page-i.xhtml#p01):
<div class="center"><span class="pb" epub:type="pagebreak" title="1" id="p01">1</span></div>

P.S. So now i'm faced w/ a decision:

  1. use this cause it works (e.g., in ADE; & hopefully epucheck wil eventually be fixed not to give 2 errors about page-list setup for no reason);
    OR
  2. don't use a page-list at all simply because buggy epubcheck doesn't like it, & i'm an obsessive dude who would like to have no errors or warnings from epubcheck.
    P.P.S. What's your take on this, & how i should proceed?
    P.P.P.S. I even adjusted (& thus resolved) everything additional related to EDUPUB, but the 2 errors mentioned epubcheck gives for a page-list regardless of type being EPUB or EDUPUB.

@haqer1
Copy link
Contributor Author

haqer1 commented Nov 6, 2016

Actually, after commenting out edupub (
<!-- <dc:type>edupub</dc:type>-->
), i'm only seeing 1 error from epubcheck:
ERROR(OPF-027): .../OEBPS/nav.xhtml(92,47): Undefined property: 'page-list'.

But it still makes me ponder over whether i should prefer using page-list feature or having no errors from epubcheck (choices in P.S. above).

@haqer1
Copy link
Contributor Author

haqer1 commented Nov 7, 2016

Getting the same in source code:

java -jar "C:\...\epubcheck\4.0.1\epubcheck.jar" "epubcheck\src\test\resources\com\adobe\epubcheck\test\xhtml\lorem_pagemaps1" --mode exp
Validating using EPUB version 3.0.1 rules.
ERROR(RSC-005): epubcheck\src\test\resources\com\adobe\epubcheck\test\xhtml\lorem_pagemaps1.epub/EPUB/lorem.opf(17,37): Error while parsing file 'attribute "page-map" not allowed here; expected attribute "id" or "page-progression-direction"'.
ERROR(OPF-027): epubcheck\src\test\resources\com\adobe\epubcheck\test\xhtml\lorem_pagemaps1.epub/EPUB/nav.xhtml(25,34): Undefined property: 'page-list'.

Check finished with errors

epubcheck completed

@rdeltour
Copy link
Member

rdeltour commented Nov 7, 2016

I can't reproduce here, and it was never reported before that page-list created issues (the property is definitely supported, we have some tests for it).

Let's try to troubleshoot the issue!

  • what's your exact environment? (OS, Java version).
  • where did you get EpubCheck? (latest release download from GitHub? or is it a custom build?)

@haqer1 haqer1 changed the title page-list validation seems to be broken page-list validation is broken with Turkish Windows 7 desktop (possibly also other Turkish Windows desktops, as well as other locales) Nov 7, 2016
@haqer1
Copy link
Contributor Author

haqer1 commented Nov 7, 2016

I have determined that the issue disappears after changing the default locale of my Windows 7 user from Turkish to English: which means there is some kind of dependency on locale in epubcheck's or java's functioning during page-list validation, which breaks it (and possibly other features). I have updated the issue title to reflect this finding.

P.S. I tried debugging epubcheck in a pristine setting: new user account, new workspace, new Eclipse project. To my surpise, it reported no errors on the same .epub. I was puzzled. I went back to the other account: tweaking PATH, JAVA_HOME, MVN_HOME, etc. had no effect. I was puzzled even more. There was no CLASSPATH set in either account. Eventually, the only difference between the 2 accounts that i could notice was that the original one was set up to use Turkish locale, and the new one was in English. After changing the original user account's locale from Turkish to English, epubcheck reported no errors on the same .epub (in cmd, & in cygwin):

No errors or warnings detected.
epubcheck completed

P.P.S. Hopefully you guys can fix this, cause i wasted about 2 days on this, and (most importantly) of course epubcheck should produce the same validation results (fatals, errors, warnings, etc.) regardless of which locale the current computer user is set up to use (the only acceptable differences being l10n-related ones).

@haqer1 haqer1 changed the title page-list validation is broken with Turkish Windows 7 desktop (possibly also other Turkish Windows desktops, as well as other locales) page-list validation is broken on Windows 7 desktop with Turkish locale (possibly also other Windows desktops with Turkish locale, as well as other locales) Nov 7, 2016
@haqer1 haqer1 changed the title page-list validation is broken on Windows 7 desktop with Turkish locale (possibly also other Windows desktops with Turkish locale, as well as other locales) page-list validation is broken on Windows 7 desktop set up to use Turkish locale (possibly also other Windows desktops set up to use Turkish locale, as well as some other locales) Nov 7, 2016
@rdeltour
Copy link
Member

rdeltour commented Nov 7, 2016

I have determined that the issue disappears after changing the default locale of my Windows 7 user from Turkish to English

Good catch! I can now reproduce the error, I'll try to work on a fix when time allows.

@rdeltour rdeltour added the type: bug The issue describes a bug label Nov 7, 2016
@rdeltour rdeltour added this to the Next milestone Nov 7, 2016
@rdeltour rdeltour self-assigned this Nov 7, 2016
@rdeltour rdeltour changed the title page-list validation is broken on Windows 7 desktop set up to use Turkish locale (possibly also other Windows desktops set up to use Turkish locale, as well as some other locales) false positives due to locale settings Nov 7, 2016
rdeltour added a commit that referenced this issue Nov 7, 2016
@rdeltour
Copy link
Member

rdeltour commented Nov 7, 2016

Fixed in the source code. Thanks for the report!

@rdeltour rdeltour closed this as completed Nov 7, 2016
haqer1 added a commit to haqer1/epubcheck that referenced this issue Nov 7, 2016
… default locale for the duration of the test that tests that the case transformations are indeed locale-independent.

Better testing of fix for issue w3c#711.
@tofi86 tofi86 modified the milestones: Next, 4.0.2 Dec 11, 2016
tofi86 pushed a commit that referenced this issue Dec 20, 2016
…n appropriate default locale for the duration of the test (#712)

* Improves Epub30CheckExpandedTest.testPageList() by actually setting a default locale for the duration of the test that tests that the case transformations are indeed locale-independent.

Better testing of fix for issue #711.

* Minor tweaks in comment wording.

Perhaps configuring CI to run unit tests under random default locales or
once in a while to run them under a number of different default locales
is also worth considering (this could allow catching some similar issues
proactively before they are reported by end-users).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue describes a bug
Projects
None yet
Development

No branches or pull requests

3 participants