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

Mark Wiebe mwwiebe@gmail....
Sat Mar 26 18:58:58 CDT 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@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@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110326/bb30aed4/attachment-0001.html 


More information about the NumPy-Discussion mailing list