Suppress unreachable symbol warnings; don't write cached tables #250
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.
Address two outstanding issues that are especially a problem when using flanker in a frozen application (i.e. using pyinstaller).
#231 Disable warnings on first run
When addresslib is first imported, the yacc parser gets run and logs a bunch of warnings about missing symbols. This pollutes the stdout (or maybe stderr) of the application using it. And when freezing with pyInstaller, the directory with cached tables is removed between runs, so this happens on every run. I have no idea if these warnings are themselves a bug, but they shouldn't be exposed like this and setting
check_recursion=False
suppresses them.#208 Don't generate cached parser tables
When running in a read-only filesystem, yacc will fail to write out the cached parser tables. This affects, for example, AWS Lambda and pyInstaller builds. It's not fatal, but it does generate an error in the application output each time.
There is a cost to
write_tables=False
, since we will have to re-parse on the next startup. But it's worth noting that the next version of the yacc module will do away with caching entirely, and the author considers it of negligible performance benefit:Testing
Have verified no regressions in
nosetests
.