[NumPy-Tickets] [NumPy] #2081: String gets truncated in asarray() in Python 3.2

NumPy Trac numpy-tickets@scipy....
Thu Mar 15 23:48:53 CDT 2012


#2081: String gets truncated in asarray() in Python 3.2
-----------------------+----------------------------------------------------
 Reporter:  taldcroft  |       Owner:  somebody    
     Type:  defect     |      Status:  needs_review
 Priority:  normal     |   Milestone:  Unscheduled 
Component:  Other      |     Version:  devel       
 Keywords:             |  
-----------------------+----------------------------------------------------
Changes (by taldcroft):

 * cc: aldcroft@… (added)
  * status:  needs_info => needs_review


Comment:

 Replying to [comment:3 charris]:
 > I still can't reproduce this:
 >
 >
 > {{{
 > >>> import numpy as np
 > >>> d = np.array(['a'])
 > >>> np.asarray([d[0]])
 > array(['a'],
 >       dtype='<U1')
 > >>> d = np.array(['abcd'])
 > >>> np.asarray([d[0]])
 > array(['abcd'],
 >       dtype='<U4')
 > >>> np.__version__
 > '1.7.0.dev-0258f19'
 >
 > }}}
 >
 > I wonder if this is a bug in python 3.2.0? I'm running 3.2.1 and gcc
 4.6.1. Just to be sure it's nothing, can you remove the build and install
 directories and do a clean install.

 I installed a fresh copy of Python 3.2.2.3 from ActiveState community
 edition, deleted the build/ directory in my git numpy repo, set my PATH to
 start with the ActivePython bin directory, and ran "python3 setup.py
 install".  I still see the same problem (see below).

 I should note that this all started with the same problem that showed up
 in a Shining Panda Jenkins instance using Python 3.2 and numpy-dev.  I
 think that is running Debian (but I am not certain of details), so this
 issue is probably not restricted to CentOS-5 or ActivePython.

 {{{
 ActivePython 3.2.2.3 (ActiveState Software Inc.) based on
 Python 3.2.2 (default, Sep  8 2011, 12:20:18)
 [GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy as np
 >>> np.__version__
 '1.7.0.dev-cfee94e'
 >>> d = np.array(['a'])
 >>> np.asarray([d[0]])
 array([''],
       dtype='<U0')
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2081#comment:4>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list