-
Notifications
You must be signed in to change notification settings - Fork 204
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
parsetab module is not always generated property by ply #168
Comments
I also had this problem intermittently when deploying to Heroku. I solved it by adding a pre-start script to my Procfile that imports flanker so the parsetab is generated, and then runs my production app. Seems to work, although it's a bit of a hack. |
We tried something similar, but with no success. It seems that the issue is somehow connected to gevent. We haven't experienced it with non-gevent processes. |
Still having this problem, even with the pre-start script, and without using gevent. Other options:
I've followed the first approach with spacedogXYZ@54d5008 and it appears to work for my use case, although I haven't benchmarked it heavily. |
According to this answer this may be a regression from PLY 3.4 to 3.6. (I'm having the same problem as described in that thread with the SWIG-generated Python 2 bindings for GLPK; I have PLY 3.10 installed.) |
As of #188 we ship |
We're still seeing this error with 0.9.0, but for a different module -- what could be the fix?
|
Try pinning ply to v3.10, it is the version used to generate parsetab files shipped with Flanker. If the ply version installed is other than v3.10, then it regenerates the parsetab files. That obviously happens in your case and the regenerated files are missing |
thanks, that appears to fix it. appreciate the help. |
👍 glad to help |
The previous implementation had issues with multiple python processes simultaneously invoking `.yacc(...)` with the same arugments. One of them could be midway through generating a .py file that the other process would attempt to import and then crash with a `SyntaxError`. This diff avoids that problem by instead writing to a tempfile and then atomically renaming it. This means processes starting up at the same time will both do the same work, but that's a lot better than having one of them crash! `flanker` had this issue reported to them in mailgun/flanker#168 and they attempted to work around this by committing the parsetab files that ply generates (mailgun/flanker#188), but this doesn't help if the user is running a different version of ply than the version that flanker generated their parsetab files with (because ply will go ahead and regenerate those files).
It seems that there is some race condition with
parsetab
module that PLY generates. On flanker-0.7.2 we are getting the error that reproduces randomly in identical environments:parsetab.py
file is correct and has all expected variables. Howeverparsetab.pyc
seems to be an empty module. After removingpyc
filefrom flanker.addresslib import address
works correctly.May be it is worth to add a generated
parsetab.py
into the package distribution?The text was updated successfully, but these errors were encountered: