[C++-sig] strange error

David Abrahams dave at boost-consulting.com
Wed Oct 16 17:15:39 CEST 2002


Stefan Seefeld <stefan.seefeld at orthosoft.ca> writes:

> hi there,
> 
> here is a (python) error I'v run across a couple of times
> without understanding what it represents / comes from:
> 
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
> TypeError: __repr__ returned non-string (type str)
> 
> It looks as if I called (implicitely at least) a string
> conversion function but the __repr__ function didn't return
> what it is supposed to: a string.
> 
> The most puzzling is now that I have defined a wrapper
> for a C++ method 'void Foo::bar(...)', and this
> error is printed when a call to 'foo' returns.
> The internals of Foo::bar are not seen by python, and the
> return value is void, where does a string conversion attempt
> come into play here ?
> 
> Thanks,
> 		Stefan
> 
> PS: I even tried
> 
> r = foo.bar()
> print type(r)
> 
> and then the 'print type(r)' would raise the above error...

Can you post code which reproduces the problem?
A Jamfile, too, please, if possible.
-- 
           David Abrahams * Boost Consulting
dave at boost-consulting.com * http://www.boost-consulting.com





More information about the Cplusplus-sig mailing list