Bug 854979

Summary: Python-2.4 incompatible syntax
Product: [Fedora] Fedora EPEL Reporter: Vitaly Kuznetsov <vkuznets>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el5CC: crobinso, dcantrell, dzickus, wwoods
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: 2012-11-28 14:58:35 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:
Attachments:
Description Flags
Updated python-bugzilla-2.4-backcompat.patch none

Description Vitaly Kuznetsov 2012-09-06 12:39:46 UTC
Description of problem:
python-bugzilla in EPEL5 has python2.4-incompatible syntax:
bugzilla 
Traceback (most recent call last):
  File "/usr/bin/bugzilla", line 17, in ?
    import bugzilla.util
  File "/usr/lib/python2.4/site-packages/bugzilla/util.py", line 31
    except OSError as e:

Here is 1-line fix:
 perl -pi -e "s/except (.*) as (.*):/except \$1, \$2:/g" /usr/lib/python2.4/site-packages/bugzilla/util.py

# rpm -q python-bugzilla
python-bugzilla-0.7.0-1.el5

Version-Release number of selected component (if applicable):
0.7.0-1.el5

How reproducible:

Steps to Reproduce:
1.Install python-bugzilla
2.run bugzilla
  
Actual results:
# bugzilla 
Traceback (most recent call last):
  File "/usr/bin/bugzilla", line 17, in ?
    import bugzilla.util
  File "/usr/lib/python2.4/site-packages/bugzilla/util.py", line 31
    except OSError as e:

Expected results:
# bugzilla 
usage: bugzilla [global options] COMMAND [command-options]
Commands: login, new, query, modify, attach, info

bugzilla: error: command must be one of: login,new,query,modify,attach,info

Additional info:

Comment 1 Toshio Ernie Kuratomi 2012-09-06 14:42:51 UTC
Created attachment 610371 [details]
Updated python-bugzilla-2.4-backcompat.patch

Here's the python-bugzilla 2.4 backcompat patch updated to fix the exception syntax.  The changed portion is this addition:

 
Index: python-bugzilla-0.7.0/bugzilla/util.py
===================================================================
--- python-bugzilla-0.7.0.orig/bugzilla/util.py
+++ python-bugzilla-0.7.0/bugzilla/util.py
@@ -28,7 +28,7 @@ def open_without_clobber(name, *args):
     while fd is None:
         try:
             fd = os.open(name, os.O_CREAT|os.O_EXCL, 0666)
-        except OSError as e:
+        except OSError, e:
             if e.errno == os.errno.EEXIST:
                 name = "%s.%i" % (orig_name, count)
                 count += 1


I checked that there are presently no other places that use the as syntax.

If we're preparing (in upstream) for python3, we probably want to switch all exception handling to the as syntax and the difference will become greater.  (Perhaps we'd be able to use 3to2 on that, though)....

Comment 2 Fedora Update System 2012-10-18 22:04:22 UTC
python-bugzilla-0.7.0-2.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/python-bugzilla-0.7.0-2.el5

Comment 3 Cole Robinson 2012-10-18 22:04:50 UTC
Thanks Toshio, I used your fix.

Comment 4 Fedora Update System 2012-10-19 13:06:51 UTC
Package python-bugzilla-0.7.0-2.el5:
* should fix your issue,
* was pushed to the Fedora EPEL 5 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing python-bugzilla-0.7.0-2.el5'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-13225/python-bugzilla-0.7.0-2.el5
then log in and leave karma (feedback).

Comment 5 Cole Robinson 2012-11-28 14:58:35 UTC
Package hit stable