Bug 1301033 - Python 3: Fedora-specific rpmbuild hooks patch contains unknown symbols
Python 3: Fedora-specific rpmbuild hooks patch contains unknown symbols
Product: Fedora
Classification: Fedora
Component: python3 (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Robert Kuska
Fedora Extras Quality Assurance
Depends On:
Blocks: 1287556
  Show dependency treegraph
Reported: 2016-01-22 06:38 EST by Felix Schwarz
Modified: 2016-03-17 05:43 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-17 05:43:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Felix Schwarz 2016-01-22 06:38:12 EST
The python3 package (rawhide, git 1eeebcf2) has a patch "00132-add-rpmbuild-hooks-to-unittest.patch" which contains broken code (as far as I can see).

For example line 45 of said patch references a "_ExpectedFailure" exception which was part of unittest.case in Python 2 but isn't anymore in Python 3.

I guess that is not a problem right now (as nobody seems to have noticed the problem so far) but you probably want to review/clean up that patch.
Comment 1 Petr Viktorin 2016-01-22 07:39:36 EST
Thanks for reporting, Felix!

Robert, I think this is right up your alley.
Comment 2 Felix Schwarz 2016-01-22 07:41:06 EST
Btw: Python 3.4 changed the way unexpectedfailures are implement so the patch probably still works for Python 3.3.
Comment 3 Robert Kuska 2016-01-22 08:34:38 EST
I will look into it as a part of python3 spec file clean up process. Thank you!
Comment 4 Jan Kurik 2016-02-24 10:44:42 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
Comment 5 Robert Kuska 2016-03-17 05:38:00 EDT
This is the patch:


Simple grep -Ri _expectedfailureinrpm will show that this decorator isn't being used anywhere. The fix is easy:

-    @functools.wraps(func)
-    def wrapper(*args, **kwargs):
-        if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
-            try:
-                func(*args, **kwargs)
-            except Exception:
-                raise _ExpectedFailure(sys.exc_info())
-            raise _UnexpectedSuccess
-        else:
-            # Call directly:
-            func(*args, **kwargs)
-    return wrapper
+    if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
+        return expectedFailure(func)
+    return func

But I would prefer dropping this function.
Comment 6 Robert Kuska 2016-03-17 05:43:48 EDT
I've removed the function.


Note You need to log in before you can comment on or make changes to this bug.