Bug 1301033

Summary: Python 3: Fedora-specific rpmbuild hooks patch contains unknown symbols
Product: [Fedora] Fedora Reporter: Felix Schwarz <fschwarz>
Component: python3Assignee: Robert Kuska <rkuska>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 24CC: bkabrda, jberan, pviktori, rkuska, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-17 09:43:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1287556    

Description Felix Schwarz 2016-01-22 11:38:12 UTC
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 (pviktori) 2016-01-22 12:39:36 UTC
Thanks for reporting, Felix!

Robert, I think this is right up your alley.

Comment 2 Felix Schwarz 2016-01-22 12:41:06 UTC
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 13:34:38 UTC
I will look into it as a part of python3 spec file clean up process. Thank you!

Comment 4 Jan Kurik 2016-02-24 15:44:42 UTC
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:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 5 Robert Kuska 2016-03-17 09:38:00 UTC
This is the patch:

http://pkgs.fedoraproject.org/cgit/rpms/python3.git/tree/00132-add-rpmbuild-hooks-to-unittest.patch?id=28c36c694


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 09:43:48 UTC
I've removed the function.

http://pkgs.fedoraproject.org/cgit/rpms/python3.git/commit/?id=a1c0d073e