Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274210 - dev-python/PyQt4-4.5: invalid syntax for Python 2.5 in files
Summary: dev-python/PyQt4-4.5: invalid syntax for Python 2.5 in files
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Qt Bug Alias
URL: http://docs.python.org/whatsnew/2.6.h...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-15 10:25 UTC by Fabio Erculiani (RETIRED)
Modified: 2009-06-20 14:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
>= Python 2.5 support patch (PyQt4-4.5-python2.5-support.patch,1.81 KB, patch)
2009-06-15 10:26 UTC, Fabio Erculiani (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Erculiani (RETIRED) gentoo-dev 2009-06-15 10:25:32 UTC
dev-python/PyQt4-4.5 is shipped with some Python files that strictly require Python 2.6 due to inaccurate (by upstream) syntax choices.

The syntax "except Exception as e" is not supported in Python 2.5. This causes pkg_postinst (while byte-compiling .py files) to print errors.

I suppose there is no need for more explanation since Python/Qt herds know what I am "talking" about.

The fix is quite trivial and attached.

Reproducible: Always

Steps to Reproduce:
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2009-06-15 10:26:19 UTC
Created attachment 194761 [details, diff]
>= Python 2.5 support patch
Comment 2 Fabio Erculiani (RETIRED) gentoo-dev 2009-06-15 10:33:46 UTC
I am a bit unsure about Python 2.5 metaclass support, so I ask somebody to review that part of the patch.
Comment 3 Markos Chandras (RETIRED) gentoo-dev 2009-06-17 14:21:19 UTC
*** Bug 274499 has been marked as a duplicate of this bug. ***
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2009-06-18 09:37:19 UTC
This is invalid IMHO. You are trying to patch files in port_v3 which is only imported if python version is >= 3.0, and that syntax is perfectly valid in python 3.0 and above.
Actually there is an issue with those files and python_mod_optimize, but it'll be taken care of in bug #274499.
Comment 5 Fabio Erculiani (RETIRED) gentoo-dev 2009-06-18 09:39:36 UTC
Both syntaxes are valid in Python 3.0 AFAIK. So, my patch does not cause any regression.
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2009-06-18 10:14:42 UTC
(In reply to comment #5)
> Both syntaxes are valid in Python 3.0 AFAIK. So, my patch does not cause any
> regression.
> 

This is not the point. AFAICS you are changing correct upstream code for no valid reason.
Comment 7 Fabio Erculiani (RETIRED) gentoo-dev 2009-06-18 10:19:05 UTC
We can discuss about better ways to fix the issue, but "no valid reasons" doesn't mean anything. Reason is: fix errors, if there's a better, clean way to do that, then great, stop writing and post a patch.
Comment 8 Davide Pesavento (RETIRED) gentoo-dev 2009-06-18 10:51:47 UTC
"fix the issue"? What issue are you talking about? The code in port_v3 is fine. The compilation errors arise from calling python_mod_optimize, as I already said. Changing that code is not the way to go IMHO. I've already proposed a workaround in bug #274499, but the proper fix would be installing port_v3 OR port_v2, based on the python version we are building against. There's no point in having both port_v2 and port_v3 installed.
Comment 9 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-06-20 14:04:50 UTC
'except exception, variable' is invalid in Python 3.