Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

Add a functional test for restore_signals=True. #51

Merged
merged 7 commits into from
Jun 5, 2018
Merged

Conversation

gpshead
Copy link
Contributor

@gpshead gpshead commented Jun 5, 2018

It wasn't being compiled as anything useful due to a missing
include of signal.h. This also adds the missing functional test
that would have caught this. Needs pushing to upstream CPython
as well.

Reported by Tom Knych.

It wasn't being compiled as anything useful due to a missing
include of signal.h.  This also adds the missing functional test
that would have caught this.  Needs pushing to upstream CPython
as well.
@gpshead gpshead self-assigned this Jun 5, 2018
@gpshead gpshead changed the title Fix restore_signals=True to not be a no-op! Add a functional test for restore_signals=True. Jun 5, 2018
@gpshead
Copy link
Contributor Author

gpshead commented Jun 5, 2018

it was being compiled properly in most environments, just not one we had. this adds a functional test and makes sure signal.h is explicitly included. though in many environments this already happens.

@nirs
Copy link

nirs commented Jun 5, 2018

@gpshead, did you file a bpo for this? We would like to get this fix for both python and python-subprocess32 in Fedora and RHEL.

ChangeLog Outdated
-----------------
2018-06-04 3.5.2 (not yet released)
-----------------
* Fixed: restore_signals=True was a no-op due to a missing #include.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true for everywhere, or only on some platforms?

@@ -2,6 +2,12 @@
This file is #included by _posixsubprocess.c and the functions
are declared static to avoid exposing them outside this module. */

/* _posixsubprocess_config.h was already included by _posixsubprocess.c
* which is #include'ing us despite the .c name. HAVE_SIGNAL_H comes
* from there. Yes, confusing! */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is confusing. If this module is not compiled separately but included by _posixsubprocess.c, why not name this _posixsubprocess_helpers.c? I guess we keep it as is because this is the way it was in upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream CPython doesn't have this file, the helpers file contains things that are built in to the Python 3 interpreter.

@gpshead
Copy link
Contributor Author

gpshead commented Jun 5, 2018

I am unable to reproduce this as a bug upstream. It does the right thing. Test added regardless: python/cpython#7414

@gpshead gpshead merged commit 3eb5c96 into master Jun 5, 2018
@gpshead gpshead deleted the restore_signals branch June 5, 2018 19:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants