Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
bpo-34412: strsignal(3) does not exist on HP-UX#8786
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Modules/signalmodule.c Outdated
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.
This comment is now somewhat inaccurate
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.
Shall I drop it?
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.
I'd keep it and add HP-UX instead.
berkerpeksag left a comment
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.
Please add a NEWS entry. Seehttps://devguide.python.org/committing/#what-s-new-and-news-entries for details.
Please regenerate
configure.Does the
test_strsignaltest inLib/test/test_signal.pypassed on HP-UX when you applied this patch?
configure.ac Outdated
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.
Can't we addstrsignal to the list athttps://github.com/python/cpython/blob/7980d771c76d55aca55e1e619bada7c4707305b2/configure.ac#L3433 ?
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.
I have considered this, but it isnowhere documented that it will includestring.h. I went for the safe bet.
berkerpeksagAug 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Many of the functions listed there require a header file to be included and none of them are documented in the autoconf documentation. For example,alarm() requiresunistd.h andModules/signalmodule.c already uses it:
Does that check works on HP-UX? If it works, I think we can try addingsignalstr to that list.
Currently,configure.ac is a mess, so it would nice if we can keep it shorter :)
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.
I will check that too.
michael-oAug 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Just check on FreeBSD and HP-UX. It does its job in bothconfig.log andconfig.status for both platforms. Will change accordingly.
bedevere-bot commentedAug 16, 2018
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
michael-o commentedAug 16, 2018 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading.Please reload this page.
Output: |
26627f0 to20df665Comparemichael-o commentedAug 16, 2018
I have made the requested changes; please review again |
bedevere-bot commentedAug 16, 2018
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
tiran left a comment
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.
You have a typo in your test:
======================================================================ERROR: test_strsignal (test.test_signal.PosixTests)----------------------------------------------------------------------Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/test_signal.py", line 66, in test_strsignal self.assertIn("Hangup", signal.strsignal(singal.SIGHUP))NameError: name 'singal' is not definedbedevere-bot commentedAug 16, 2018
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Lib/test/test_signal.py Outdated
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.
I thinkSIGHUP is a pretty common signal, so it can be added to the list inModules/signalmodule.c:
#ifndefMS_WINDOWS/* TODO: Add a comment to explain why we need this on HP-UX. */caseSIGHUP:res="Hangup";break;#endif
Then we can testself.assertIn("Hangup", signal.strsignal(singal.SIGHUP)) unconditionally.
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.
Can we say something like "make :func:`signal.strsignal` work on HP-UX"?
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.
Please add "Patch by Your Name.".
391f445 tobdc1a80Comparemichael-o commentedAug 17, 2018
I have made the requested changes; please review again |
bedevere-bot commentedAug 17, 2018
Thanks for making the requested changes! @tiran,@berkerpeksag: please review the changes made to this pull request. |
michael-o commentedAug 17, 2018
There are test failures on Windows because |
berkerpeksag commentedAug 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Did you cover it with |
michael-o commentedAug 17, 2018
So you are looking for this: This isn't there, I can add this. Shall I? |
michael-o commentedAug 17, 2018
@berkerpeksag Change pushed. |
michael-o commentedAug 17, 2018
I have made the requested changes; please review again |
bedevere-bot commentedAug 17, 2018
Thanks for making the requested changes! @tiran,@berkerpeksag: please review the changes made to this pull request. |
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.
Nit: make -> Make
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.
Will do.
Modules/signalmodule.c Outdated
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.
This list was just a redefinition of POSIX signals supported by Windows. I think we need to check whether there is more than one signal to add to this list for other Unix systems.
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.
Well, I can go throughsignal.h on HP-UX and provide those, but this is out of scope of this PR because the motivation for this one is just to make this module properly compile on HP-UX. Is that OK for you?
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.
@berkerpeksag I went throughsignal.h. There is a bus load of signals, some wrapped with ifdefs. I don't think that HP-UX is worth the effort for now just to have a nice string. If so, this has to be a separate PR.
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.
We definitely can't maintain a full list of signals for every platform we support, so I agree with you. I was wondering whether there are other signals to include to makestrsignal() useful for most common cases.
I just checkedhttp://nixdoc.net/man-pages/hp-ux/man5/signal.5.html and I think the most common unlisted signals are SIGALRM, SIGPIPE, SIGQUIT, and SIGCHLD.
Since SIGINT and SIGTERM is already in the list, I'd expect SIGQUIT to be there as well.
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.
So, I added all those. checked FreeBSD and glibc implementation + manpages and took the strings (_sys_siglist[]) out of them. They are identical. I am sure whether the tests should be extented because the Open Group says aboutstrsignal(3) that the return value is implementation-defined.
@berkerpeksag WDYT?
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.
Awesome, thanks! No need to update the tests.
I will take another look at this and merge tonight.
bedevere-bot commentedAug 19, 2018
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
michael-o commentedAug 20, 2018
I have made the requested changes; please review again |
bedevere-bot commentedAug 20, 2018
Thanks for making the requested changes! @tiran,@berkerpeksag: please review the changes made to this pull request. |
michael-o commentedAug 22, 2018
@berkerpeksag are we good to merge? |
berkerpeksag commentedAug 22, 2018
@michael-o could you rerun autoreconf and commit the changes in diff --git a/pyconfig.h.in b/pyconfig.h.inindex d80ddc0..a82c373 100644--- a/pyconfig.h.in+++ b/pyconfig.h.in@@ -984,6 +984,9 @@ /* Define to 1 if you have the <stropts.h> header file. */ #undef HAVE_STROPTS_H+/* Define to 1 if you have the `strsignal' function. */+#undef HAVE_STRSIGNAL+ /* Define to 1 if `pw_gecos' is a member of `struct passwd'. */ #undef HAVE_STRUCT_PASSWD_PW_GECOS |
Addressed in the latest review. Thanks!
Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL forsignalmodule.c. This change applies for Windows and HP-UX.Patch by Michael Osipov.
michael-o commentedAug 23, 2018
I have made the requested changes; please review again @berkerpeksag Done. Should be fine now. Have a look please. |
bedevere-bot commentedAug 23, 2018
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
berkerpeksag commentedAug 23, 2018
Thanks! |
michael-o commentedAug 23, 2018
@berkerpeksag Thanks for merging. Would you mind to take a look at my other HP-UX related PRs? I'd like to continue contributing. |
berkerpeksag commentedAug 23, 2018
@michael-o I'm looking at#8846 and#8828, but the PRs about |
Uh oh!
There was an error while loading.Please reload this page.
Introduce a configure check for strsignal(3) and define HAVE_STRSIGNAL for
signalmodule.c. This change applies for Windows and HP-UX.
https://bugs.python.org/issue34412