Fix #117: Only open tds/twb inside archives #118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #117 and verified with a test.
Tableau 9.0 added workbooks that can have an external file cache embedded in the archive. Those workbooks have .key and .bin files. .key files are valid XML and there was a bug in the
find_file_in_zip
method that would return the first valid XML file it found. Now we only iterate over .twb or /tds files and try to open them (we still validate the root element a layer up). This fixes the bug and should be a little bit faster since we won't be opening as many files.@RussTheAerialist is probably still out but maybe @LGraber can fill in.
(I'm also pretty confidant in the fix, it's small, tested, and I wrote all the original code in this file anyway :) )