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

with bcp14 option, it crashes instead of giving useful output #1

Open
alicerusso opened this issue May 5, 2022 · 2 comments
Open

Comments

@alicerusso
Copy link

When running rfclint -n --bcp14 --no-spell --no-xml --no-abnf --no-dup-detection (as a script called checkbcp14), it crashes when <bcp14> tags are missing, rather than giving output to point out the missing element.

Looks like a similar crash, whether the input contains a "MUST", "MUST NOT", "MAY" (or other keyword from BCP 14) that is missing the <bcp14>. Previously, it gave output such as:

file.xml:886: bcp14 text 'MAY' found without bcp14 tag around it

Sample input: https://www.rfc-editor.org/v3test/test9229.xml
(missing tags around "MUST" on line 289)

% rfclint -n --bcp14 --no-spell --no-xml --no-abnf --no-dup-detection test9229.xml
Traceback (most recent call last):
  File "/usr/bin/rfclint", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/rfclint/run.py", line 355, in main
    lang2119.processTree(xmlrfc.tree.getroot())
  File "/usr/lib/python3.6/site-packages/rfclint/must.py", line 71, in processTree
    self.processTree(node)
  File "/usr/lib/python3.6/site-packages/rfclint/must.py", line 71, in processTree
    self.processTree(node)
  File "/usr/lib/python3.6/site-packages/rfclint/must.py", line 71, in processTree
    self.processTree(node)
  [Previous line repeated 2 more times]
  File "/usr/lib/python3.6/site-packages/rfclint/must.py", line 69, in processTree
    self.checkTree(tree)
  File "/usr/lib/python3.6/site-packages/rfclint/must.py", line 117, in checkTree
    self.checkTree(node)
  File "/usr/lib/python3.6/site-packages/rfclint/must.py", line 111, in checkTree
    xx = self.bcp14_re.finditer(tree.text)
TypeError: expected string or bytes-like object

Sample input: https://www.rfc-editor.org/v3test/test9143.xml
(missing tags around "MUST NOT" on line 1720)
yields same Traceback.

@alicerusso
Copy link
Author

Another input file with the same issue (Traceback exactly as above):
https://www.rfc-editor.org/v3test/test9200.xml

@alicerusso
Copy link
Author

Another sample input (Traceback exactly as above):
https://www.rfc-editor.org/v3test/test9484.xml

(Useful output would be about the missing tags around "MUST NOT" on line 1553.)

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

1 participant