-
Notifications
You must be signed in to change notification settings - Fork 43
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
Optional error message conforming to Python return. KXI-1467 #100
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awilson-kx
approved these changes
May 11, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
cmccarthy1
added a commit
that referenced
this pull request
May 18, 2021
* virtual env * removed setting of python home * cleaned up p.q * working version for working environments * update base prefix * addition of py_SetProgramName * added travis virtualenv * added tests for sys commands. Added warning for windows virtual environment users * fix windows venv warning * Fixed stdOut issue (#101) * Optional error message conforming to Python return. KXI-1467 (#100) * Update to p.q logic for handling sys.argv * reintroduction of old logic * addition of initial sys argv and embedpy version check * Addition of functionality to return Python traceback rather than q shorthand * Memory leak fix and removal of environment variable check C side * reformat of prr to use modifiable global rather than env variable * Initial pass at rectifying potential buffer overflow * update to py.c to initialize traceback import on init * closer fit to code base style Co-authored-by: Conor McCarthy <conormccarthy@brainpool1.mynet> Co-authored-by: cmccarthy1 <38653604+cmccarthy1@users.noreply.github.com> Co-authored-by: Conor McCarthy <conormccarthy@brainpool1.mynet>
cmccarthy1
added a commit
that referenced
this pull request
May 21, 2021
* venv support (#99) * virtual env * removed setting of python home * cleaned up p.q * working version for working environments * update base prefix * addition of py_SetProgramName * added travis virtualenv * added tests for sys commands. Added warning for windows virtual environment users * fix windows venv warning Co-authored-by: Dianeod <40861871+Dianeod@users.noreply.github.com> Co-authored-by: Diane ODonoghue <dodonoghue@kx.com> * Venv (#102) * virtual env * removed setting of python home * cleaned up p.q * working version for working environments * update base prefix * addition of py_SetProgramName * added travis virtualenv * added tests for sys commands. Added warning for windows virtual environment users * fix windows venv warning * Fixed stdOut issue (#101) * Optional error message conforming to Python return. KXI-1467 (#100) * Update to p.q logic for handling sys.argv * reintroduction of old logic * addition of initial sys argv and embedpy version check * Addition of functionality to return Python traceback rather than q shorthand * Memory leak fix and removal of environment variable check C side * reformat of prr to use modifiable global rather than env variable * Initial pass at rectifying potential buffer overflow * update to py.c to initialize traceback import on init * closer fit to code base style Co-authored-by: Conor McCarthy <conormccarthy@brainpool1.mynet> Co-authored-by: cmccarthy1 <38653604+cmccarthy1@users.noreply.github.com> Co-authored-by: Conor McCarthy <conormccarthy@brainpool1.mynet> * Explicit note that venv support limitation is only expected to hold for Windows Co-authored-by: Dianeod <40861871+Dianeod@users.noreply.github.com> Co-authored-by: Diane ODonoghue <dodonoghue@kx.com> Co-authored-by: Conor McCarthy <conormccarthy@brainpool1.mynet>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously embedPy only provided the return 'value' of an error retrieved from Python rather than the full traceback. This is shown in the following example
a.py
When imported this file causes an error however it does not provide information relating to the location of the error in the loaded file as would be provided by the Python traceback
Users can now modify how errors are returned within their system by running
.p.setpyerr[1]
which will update the format that the error message gets returned, namely returning the error traceback if it can be formed so that it can be parsed by the user within a protected execution. This is left to the user.p.q
andp.k
to$QHOME
in line with any changes to these files.gitignore
to ignore any artefacts generated during the make processmake
thep.so
during amake install
if not already generated