[Numpy-discussion] ValueError: Unknown format code 'g' for object of type 'str'

Mark Wiebe mwwiebe at gmail.com
Sat Mar 26 19:58:58 EDT 2011


It turns out that Python 2.6 complex doesn't implement __format__, and that
results in the problem.

http://web.archiveorange.com/archive/v/jA6s92Ni29ENZpi4rpz5

I've disabled the complex formatting tests for 2.6 in
commit 7d436cc8994f9efbc512.

<http://web.archiveorange.com/archive/v/jA6s92Ni29ENZpi4rpz5>-Mark

On Sat, Mar 26, 2011 at 3:34 AM, Nils Wagner
<nwagner at iam.uni-stuttgart.de>wrote:

> >>> numpy.__version__
> '2.0.0.dev-10db259'
>
> ======================================================================
> ERROR: Test the str.format method with NumPy scalar types
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
>
> "/home/nwagner/local/lib64/python2.6/site-packages/nose-0.11.2.dev-py2.6.egg/nose/case.py",
> line 183, in runTest
>     self.test(*self.arg)
>   File
>
> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/testing/decorators.py",
> line 146, in skipper_func
>     return f(*args, **kwargs)
>   File
>
> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/core/tests/test_print.py",
> line 223, in test_scalar_format
>     assert_equal(fmat.format(val),
> fmat.format(valtype(val)),
> ValueError: Unknown format code 'g' for object of type
> 'str'
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110326/bb30aed4/attachment.html>


More information about the NumPy-Discussion mailing list