Bug 1301033 - Python 3: Fedora-specific rpmbuild hooks patch contains unknown symbols
Summary: Python 3: Fedora-specific rpmbuild hooks patch contains unknown symbols
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Robert Kuska
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1287556
TreeView+ depends on / blocked
 
Reported: 2016-01-22 11:38 UTC by Felix Schwarz
Modified: 2016-03-17 09:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-17 09:43:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


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