[reportlab-users] graphics/charts/axes.py TypeError: _makeLines() takes at most 8 arguments (10 given)

Robin Becker robin at reportlab.com
Mon Aug 20 05:31:49 EDT 2012


On 17/08/2012 16:07, M Hubenthal wrote:

> Hi,

>

> I am not much of a python programmer and am hoping someone can point me in the

> correct direction. I found nothing in searching the archives.

>

> I am in the process of upgrading the operating environment for an application

> that has been using reportlab 2.0 for six years. On a fresh install with 2.5, I

> received a traceback similar to the one below. Going back to current development

> environment, I stepped through the reportlab versions and found that things

> break down in 2.4. In comparing the two versions, it is clear _makeLines was

> expanded, but why does python think it only takes up to 8 arguments and it there

> something I can do to move forward?

>

> 2.3

> __version__=''' $Id: axes.py 3345 2008-12-12 17:55:22Z damian $ '''

> __doc__="""Collection of axes for charts.

>

> def

> _makeLines(self,g,start,end,strokeColor,strokeWidth,strokeDashArray,parent=None):

>

> self._makeLines(g,tU,-tD,self.strokeColor,sW,self.strokeDashArray)

>

> 2.4

> __version__=''' $Id: axes.py 3609 2009-12-07 17:58:49Z meitham $ '''

> __doc__="""Collection of axes for charts.

>

> def

> _makeLines(self,g,start,end,strokeColor,strokeWidth,strokeDashArray,strokeLineJoin,strokeLineCap,strokeMiterLimit,parent=None):

>

>

> self._makeLines(g,tU,-tD,self.strokeColor,sW,self.strokeDashArray,self.strokeLineJoin,self.strokeLineCap,self.strokeMiterLimit)

>

........

>


Mrvin,

if you just count the names in the def statement in the older version there are
clearly

7 fixed args (including self) and one keyword argument.

When the method is called on an instance the self argument is implicit ie is
added automatically so you only need to provide 6 fixed args (and optionally one
keyword argument). In the new version some extra fixed arguments were added ie
strokeLineJoin,strokeLineCap,strokeMiterLimit. So the newer version requires
more argments to be passed along. It looks like you've still got an older
version being called somehow.

Is it possible that your code has been overriding some of the axis internals? is
there a _makelines definition in your derived classes somewhere?
--
Robin Becker


More information about the reportlab-users mailing list