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

double exception #376

Closed
ietf-svn-bot opened this issue Sep 19, 2018 · 4 comments
Closed

double exception #376

ietf-svn-bot opened this issue Sep 19, 2018 · 4 comments
Labels
medium text Issues in text output

Comments

@ietf-svn-bot
Copy link

resolution_fixed type_defect | by miek@miek.nl


Thanks for the improved error reporting. Running xml2rfc 2.10.2 on learninggo.xml now gives line numbers.

However I got a double exception with it:

~/g/src/github.com/mmarkdown/mmark/mmark learninggo.md > learninggo.xml
xml2rfc --v3 learninggo.xml
Parsing file learninggo.xml
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xml2rfc/writers/preptool.py", line 207, in validate
    v3_rng.assertValid(self.tree)
  File "src/lxml/lxml.etree.pyx", line 3491, in lxml.etree._Validator.assertValid (src/lxml/lxml.etree.c:184578)
lxml.etree.DocumentInvalid: Did not expect element blockquote there, line 28

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/xml2rfc", line 11, in <module>
    load_entry_point('xml2rfc==2.10.2', 'console_scripts', 'xml2rfc')()
  File "/usr/lib/python3/dist-packages/xml2rfc/run.py", line 387, in main
    xmlrfc.tree = prep.prep()
  File "/usr/lib/python3/dist-packages/xml2rfc/writers/preptool.py", line 365, in prep
    func(e, e.getparent())
  File "/usr/lib/python3/dist-packages/xml2rfc/writers/preptool.py", line 412, in validate_before
    if not self.validate('before'):
  File "/usr/lib/python3/dist-packages/xml2rfc/writers/preptool.py", line 214, in validate
    msg = "%s(%s): %s: %s, at %s" % (self.xmlrfc.source, error.line, error.level_name.title(), error.message, error.path)
AttributeError: 'lxml.etree._LogEntry' object has no attribute 'path'
Makefile:15: recipe for target 'learninggo.txt' failed
make: *** [learninggo.txt] Error 1

Issue migrated from trac:376 at 2022-02-05 12:46:28 +0000

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com commented


Hi Miek,

Thanks for the continued testing. I ran my current copy of learninggo.xml through the release without having the experience above, so I probably need a new copy of the source, and would also appreciate knowing the switches you used when you got the result above.

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com changed status from new to closed

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com changed resolution from `` to fixed

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com commented


Fixed in e3edffe:

Tweaked the validation error reporting again. Fixes issue #376 (lxml<3.8.0 does not provide xpath to the offending element in error.path).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium text Issues in text output
Projects
None yet
Development

No branches or pull requests

1 participant