Bug 854979 - Python-2.4 incompatible syntax
Python-2.4 incompatible syntax
Status: CLOSED CURRENTRELEASE
Product: Fedora EPEL
Classification: Fedora
Component: python-bugzilla (Show other bugs)
el5
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-06 08:39 EDT by Vitaly Kuznetsov
Modified: 2013-01-10 01:54 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-28 09:58:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Updated python-bugzilla-2.4-backcompat.patch (1.47 KB, patch)
2012-09-06 10:42 EDT, Toshio Ernie Kuratomi
no flags Details | Diff

  None (edit)
Description Vitaly Kuznetsov 2012-09-06 08:39:46 EDT
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 10:42:51 EDT
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 18:04:22 EDT
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 18:04:50 EDT
Thanks Toshio, I used your fix.
Comment 4 Fedora Update System 2012-10-19 09:06:51 EDT
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 09:58:35 EST
Package hit stable

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