You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some investigation if those warnings are important it turns out they come from the ply dependency that is used to parse TAG-VALUE files. Some more digging into that code showed that it tries to create a cache of the parsing tables and has some rather contrived logic on where to store those between calls.
Some solution ideas to avoid the warnings:
The yacc code takes an outdir parameter that will be used instead of the contrived paths, see:
01/26/20 PLY no longer writes cached table files. Honestly, the use of
the cached files made more sense when I was developing PLY on
my 200Mhz PC in 2001. It's not as much as an issue now. For small
to medium sized grammars, PLY should be almost instantaneous.
If you're working with a large grammar, you can arrange
to pickle the associated grammar instance yourself if need be.
The removal of table files eliminated a large number of optional
arguments to yacc() concerning the names and packages of these files.
So in summary it seems best to update ply to its latest upstream version from Github as that has other fixes too and the previous code did quite some contrived logic to cater to very old and very slow machines.
TLDR: the ply code currently used in this library is very old and should be either updated or even replaced with some alternative LALR parser.
The text was updated successfully, but these errors were encountered:
Oh and ply code also seems to cause this issue with not being thread-safe #801 - I'm not 100% sure if updating the library will fix that but to me it seems it is related to how ply does store the parsing tables and tries to read them on next run again.
When the code is run from a read only filesystem (e.g. container) then it produces a couple of warnings to the logs, like these:
After some investigation if those warnings are important it turns out they come from the
ply
dependency that is used to parse TAG-VALUE files. Some more digging into that code showed that it tries to create a cache of the parsing tables and has some rather contrived logic on where to store those between calls.Some solution ideas to avoid the warnings:
The yacc code takes an
outdir
parameter that will be used instead of the contrived paths, see:it could be passed some temporary writable dir when instantiating the parser in:
However, doing that would require the client calling functions to also pass that parameter along and so on, or use
tempfile.mkdtemp()
and hope that it uses a writable directory and so on. In any case it complicates things.After some more digging into the upstream of
ply
https://github.com/dabeaz/ply it seems that the code is not released anymore on pypi since 2018, https://pypi.org/project/ply/3.11/ but instead it is recommended to copy the github code directly into a project that uses it! (not the best idea but see https://github.com/dabeaz/ply?tab=readme-ov-file#how-to-install-and-use )It also seems that after the last pypi release the code that causes the above spurious warnings has been removed as the changelog https://github.com/dabeaz/ply/blob/master/CHANGES mentions here:
So in summary it seems best to update
ply
to its latest upstream version from Github as that has other fixes too and the previous code did quite some contrived logic to cater to very old and very slow machines.TLDR: the
ply
code currently used in this library is very old and should be either updated or even replaced with some alternative LALR parser.The text was updated successfully, but these errors were encountered: