Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 308671 - sci-misc/pythoncad-1.36 : syntax error in PythonCAD/Generic/layer.py (emerge does not detect the failure)
Summary: sci-misc/pythoncad-1.36 : syntax error in PythonCAD/Generic/layer.py (emerge ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Cédric Krier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-09 16:37 UTC by Phil Stracchino (Unix Ronin)
Modified: 2010-03-10 23:14 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Stracchino (Unix Ronin) 2010-03-09 16:37:08 UTC
sci-misc/pythoncad-1.36 compilation fails during install and on startup with a syntax error:

>>> Installing (1 of 1) sci-misc/pythoncad-1.36
 * Compilation and optimization of Python modules for CPython 2.6 ...
Compiling //usr/lib/python2.6/site-packages/PythonCAD/Generic/layer.py ...
SyntaxError: ('invalid syntax', ('//usr/lib/python2.6/site-packages/PythonCAD/Generic/layer.py', 477, 29, '    def setAutosplit(self, as):\n'))

I'm not a Python programmer, but I experimented with this a little.  Is 'as' by any chance a reserved word in Python?  I ask because simply renaming the variable fixes this problem, as in the patch below:


--- layer.py.orig       2006-07-07 11:39:39.000000000 -0400
+++ layer.py    2010-03-09 11:32:59.663820487 -0500
@@ -472,19 +472,19 @@
                 break
         else:
             raise TypeError, "Unexpected type: " + `type(obj)`
         return (_split, _objs)

-    def setAutosplit(self, as):
+    def setAutosplit(self, asp):
         """Set the autosplit state of the Layer.

-setAutosplit(as)
+setAutosplit(asp)

-Argument 'as' must be a Boolean.
+Argument 'asp' must be a Boolean.
         """
-        util.test_boolean(as)
-        self.__asplit = as
+        util.test_boolean(asp)
+        self.__asplit = asp

     def getAutosplit(self):
         """Retrieve the autosplit state of the Layer.

 getAutosplit()


It should also be noted that emerge does not detect this failure, and reports successful installation.


Reproducible: Always

Steps to Reproduce:
1. emerge sci-misc/pythoncad is sufficient.  The emerge will fail during installation, but will not report the error.
Comment 1 Phil Stracchino (Unix Ronin) 2010-03-09 16:55:02 UTC
Further study finds that 'as' is a reserved word (but not enabled by default) in Python 2.5, and is enabled by default from Python 2.6 on.
Comment 2 Cédric Krier gentoo-dev 2010-03-10 23:14:01 UTC
Fix in CVS with version bump 1.37