<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1658" rel="nofollow">http://projects.scipy.org/numpy/ticket/1658</a> on 2010-11-02 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/FrancescAlted/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/FrancescAlted">@FrancescAlted</a>, assigned to unknown.</em></p>
<p dir="auto">This reproduces the problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; pickle.loads(pickle.dumps(np.array(u'a')))  # 1-length works well

array(u'a', 
      dtype='&lt;U1')

&gt;&gt;&gt; pickle.loads(pickle.dumps(np.array(u'')))  # 0-length does not work
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/tmp/tables-2.2/&lt;ipython console&gt; in &lt;module&gt;()

/usr/local/lib/python2.6/pickle.pyc in loads(str)
   1372 def loads(str):
   1373     file = StringIO(str)
-&gt; 1374     return Unpickler(file).load()
   1375 
   1376 # Doctest


/usr/local/lib/python2.6/pickle.pyc in load(self)
    856             while 1:
    857                 key = read(1)
--&gt; 858                 dispatch[key](self)
    859         except _Stop, stopinst:
    860             return stopinst.value

/usr/local/lib/python2.6/pickle.pyc in load_reduce(self)
   1131         args = stack.pop()
   1132         func = stack[-1]
-&gt; 1133         value = func(*args)
   1134         stack[-1] = value
   1135     dispatch[REDUCE] = load_reduce

TypeError: data type not understood"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; pickle.loads(pickle.dumps(np.array(u'a')))  # 1-length works well

array(u'a', 
      dtype='&lt;U1')

&gt;&gt;&gt; pickle.loads(pickle.dumps(np.array(u'')))  # 0-length does not work
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/tmp/tables-2.2/&lt;ipython console&gt; in &lt;module&gt;()

/usr/local/lib/python2.6/pickle.pyc in loads(str)
   1372 def loads(str):
   1373     file = StringIO(str)
-&gt; 1374     return Unpickler(file).load()
   1375 
   1376 # Doctest


/usr/local/lib/python2.6/pickle.pyc in load(self)
    856             while 1:
    857                 key = read(1)
--&gt; 858                 dispatch[key](self)
    859         except _Stop, stopinst:
    860             return stopinst.value

/usr/local/lib/python2.6/pickle.pyc in load_reduce(self)
   1131         args = stack.pop()
   1132         func = stack[-1]
-&gt; 1133         value = func(*args)
   1134         stack[-1] = value
   1135     dispatch[REDUCE] = load_reduce

TypeError: data type not understood
</code></pre></div>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1037" rel="nofollow">http://projects.scipy.org/numpy/ticket/1037</a> on 2009-03-04 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/FrancescAlted/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/FrancescAlted">@FrancescAlted</a>, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cournape/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cournape">@cournape</a>.</em></p>
<p dir="auto">This shows the problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [18]: cp = cPickle.dumps(numpy.array([u'']), 0)

In [19]: cPickle.loads(cp)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/faltet/PyTables/pytables/PyTablesPro/trunk/&lt;ipython console&gt; in &lt;module&gt;()

TypeError: ('data type not understood', &lt;type 'numpy.dtype'&gt;, ('U0', 0, 1))"><pre class="notranslate"><code class="notranslate">In [18]: cp = cPickle.dumps(numpy.array([u'']), 0)

In [19]: cPickle.loads(cp)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/faltet/PyTables/pytables/PyTablesPro/trunk/&lt;ipython console&gt; in &lt;module&gt;()

TypeError: ('data type not understood', &lt;type 'numpy.dtype'&gt;, ('U0', 0, 1))
</code></pre></div>
<p dir="auto">However, plain strings does work:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [20]: cp = cPickle.dumps(numpy.array(['']), 0)

In [21]: cPickle.loads(cp)
Out[21]:                  
array([''],               
      dtype='|S1')        "><pre class="notranslate"><code class="notranslate">In [20]: cp = cPickle.dumps(numpy.array(['']), 0)

In [21]: cPickle.loads(cp)
Out[21]:                  
array([''],               
      dtype='|S1')        
</code></pre></div>