PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 96 - add-function with "const char*" argument being translated to char
: add-function with "const char*" argument being translated to char
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: Shiboken
: HEAD
: All All
: P5 normal
Assigned To: Marcelo Lira
:
:
:
  Show dependency treegraph
 
Reported: 2009-11-09 13:31 EET by Lauro Moura
Modified: 2010-01-25 10:44 EET (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2009-11-09 13:31:41 EET
Added a test case for this at [1].

Test output: (x == String, echo should accept string)
======================================================================
ERROR: Test function added with const char * as arg
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lauro/dev/pyside/shiboken/tests/samplebinding/echo_test.py", line
40, in testEcho
    y = Echo().echo(x)
TypeError: 'echo()' called with wrong parameters.

----------------------------------------------------------------------

Generated method snippet:

    if (PyNumber_Check(arg)) {
        const char * cpp_arg0 = Shiboken::Converter<const char * >::toCpp(arg);
        // echo(const char*)
        Echo* cppSelf = PyEcho_cptr(self);
        return PyString_FromString(cpp_arg0);
    } else goto PyEcho_echo_TypeError;

[1]
http://qt.gitorious.org/~lauromoura/pyside/lauromoura-shiboken/commit/c8f83b639d465ac3ef156b42957c89d98429e5cb


This is a problem in QDataStream bindings, which uses add-function with const
char *.
Comment 1 Marcelo Lira 2009-11-09 18:48:16 EET
fixed in APIExtractor commit d8dc3d4e8ea3597497ee42b7cd02975213b858ba