Bug #15039
checkClassVersion fails to parse valid XML
Start date:
01/06/2017
Due date:
% Done:
100%
Estimated time:
4.00 h
Description
The script checkClassVersion
fails to parse XML code with comments including an odd number of single quotes.
Example on woof.fnal.gov
:
source /products/setup setup cetbuildtools v5_06_01 setup root v6_06_08 -q e10:nu:prof checkClassVersion -x <( echo $'<!-- Hey! -->' ) # success (no apostrophe) checkClassVersion -x <( echo $'<!-- What\'s up? -->' ) # failure (one apostrophe) checkClassVersion -x <( echo $'<!-- Let\'s go rockin\'! -->' ) # success (two apostrophes)
Given the weird quoting syntax in bash, let me summarise: the XML content in the three cases is
<!-- Hey! -->
(success), <!-- What's up? -->
(failure) and <!-- Let's go rockin'! -->
(success).The error on screen is:
--->> checkClassVersion: ERROR: parsing selection file /dev/fd/63 --->> checkClassVersion: ERROR: Error is: not well-formed (invalid token): line 1, column 18 Traceback (most recent call last): File "/products/cetbuildtools/v5_06_01/bin/checkClassVersion", line 372, in <module> main() File "/products/cetbuildtools/v5_06_01/bin/checkClassVersion", line 231, in main p = XmlParser(options.xmlfile) File "/products/cetbuildtools/v5_06_01/bin/checkClassVersion", line 38, in __init__ self.readClassesDefXML() File "/products/cetbuildtools/v5_06_01/bin/checkClassVersion", line 64, in readClassesDefXML p.Parse(nxml) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 18but it is not expat's fault, but rather of the preprocessing to have the special characters like
<
, >
etc. digested. The same problem occurs with double quotes:source /products/setup setup cetbuildtools v5_06_01 setup root v6_06_08 -q e10:nu:prof checkClassVersion -x <( echo '<!-- Z -->' ) # success (no double quote) checkClassVersion -x <( echo '<!-- Z" -->' ) # failure (single double quote) checkClassVersion -x <( echo '<!-- "Z" -->' ) # success (double double quote)
Associated revisions
History
#1 Updated by Kyle Knoepfel over 4 years ago
- Status changed from New to Assigned
- Assignee set to Christopher Green
- Estimated time set to 4.00 h
We are investigating the parameters of the problem. The time estimate reflects analysis only.
#2 Updated by Kyle Knoepfel about 4 years ago
- Status changed from Assigned to Resolved
- Target version set to 2.06.00
- % Done changed from 0 to 100
#3 Updated by Kyle Knoepfel about 4 years ago
- Status changed from Resolved to Closed
Fix for issue #15039.