Discussion:
core.py: TypeError: keyword arguments are not supported
Michael Hipp
2014-03-01 01:21:02 UTC
Permalink
I'm seeing this exception on the last line of this snippet from core.py.
Am I correct this looks like a bug.

Michael

File
"C:\dev\virtenvs\auction\Lib\site-packages\wxPython_Phoenix-3.0.1.dev76030-py2.7-win32.egg\wx\core.py",
line 69, in __init__
item.__init__(*args, **kw)

TypeError: keyword arguments are not supported



def deprecated(item, msg='', useName=False):
"""
Create a delegating wrapper that raises a deprecation warning. Can be
used with callable objects (functions, methods, classes) or with
properties.
"""
import warnings

name = ''
if useName:
try:
name = ' ' + item.__name__
except AttributeError:
pass

if isinstance(item, type):
# It is a class. Make a subclass that raises a warning.
class DeprecatedClassProxy(item):
def __init__(*args, **kw):
warnings.warn("Using deprecated class%s. %s" % (name, msg),
wxPyDeprecationWarning, stacklevel=2)
item.__init__(*args, **kw)
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Robin Dunn
2014-03-02 00:10:11 UTC
Permalink
Post by Michael Hipp
I'm seeing this exception on the last line of this snippet from core.py.
Am I correct this looks like a bug.
Michael
File
"C:\dev\virtenvs\auction\Lib\site-packages\wxPython_Phoenix-3.0.1.dev76030-py2.7-win32.egg\wx\core.py",
line 69, in __init__
item.__init__(*args, **kw)
TypeError: keyword arguments are not supported
What class are you trying to instantiate there? I've noticed this
before, I think it was when trying to call a deprecated function that
took zero args. SIP is using an optimization in that case where it
simply doesn't allow keyword args because there can't be any args at
all, so passing an empty dict for **kw is triggering a built-in Python
exception.
--
Robin Dunn
Software Craftsman
http://wxPython.org
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Michael Hipp
2014-03-02 01:10:43 UTC
Permalink
Post by Robin Dunn
Post by Michael Hipp
I'm seeing this exception on the last line of this snippet from core.py.
Am I correct this looks like a bug.
Michael
File
"C:\dev\virtenvs\auction\Lib\site-packages\wxPython_Phoenix-3.0.1.dev76030-py2.7-win32.egg\wx\core.py",
line 69, in __init__
item.__init__(*args, **kw)
TypeError: keyword arguments are not supported
What class are you trying to instantiate there?
Here's the offending code:

import wx.grid as gridlib

class HugeTable(gridlib.PyGridTableBase):
def __init__(self, loader):
gridlib.PyGridTableBase.__init__(self)

The __init__ call is where it crashes. Obviously the fix is to just
change it to GridTableBase, but a deprecation warning is probably needed.

Michael
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...