<p dir="auto">Let's say I use a data file <code class="notranslate">data.txt</code> containing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a b c
d e f"><pre class="notranslate"><code class="notranslate">a b c
d e f
</code></pre></div>
<p dir="auto">If I do (in Python 3.4):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
data = np.loadtxt('data.txt', dtype='U')
print(data)"><pre class="notranslate"><code class="notranslate">import numpy as np
data = np.loadtxt('data.txt', dtype='U')
print(data)
</code></pre></div>
<p dir="auto">I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[[&quot;b'a'&quot; &quot;b'b'&quot; &quot;b'c'&quot;]
 [&quot;b'd'&quot; &quot;b'e'&quot; &quot;b'f'&quot;]]"><pre class="notranslate"><code class="notranslate">[["b'a'" "b'b'" "b'c'"]
 ["b'd'" "b'e'" "b'f'"]]
</code></pre></div>
<p dir="auto">Note that the <code class="notranslate">b</code> is actually part of the string, so there is something wrong here. The same happens if I use <code class="notranslate">dtype='U'</code>. I am using Numpy dev as of <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/numpy/numpy/commit/a02f5c8fd384b5aeffd1942747b4b6c4efdcd3a4/hovercard" href="https://github.com/numpy/numpy/commit/a02f5c8fd384b5aeffd1942747b4b6c4efdcd3a4"><tt>a02f5c8</tt></a>.</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Python: Version 3.3 (python.org release) on OS X Mountain Lion</li>
<li>numpy: Cloned from git master</li>
</ul>
<p dir="auto">When calling <code class="notranslate">numpy.loadtxt</code> on file containing strings as follows:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
datestxt = np.loadtxt(&quot;NYSE_dates.txt&quot;, dtype=str)
print(datetxt)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">datestxt</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">loadtxt</span>(<span class="pl-s">"NYSE_dates.txt"</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">str</span>)
<span class="pl-en">print</span>(<span class="pl-s1">datetxt</span>)</pre></div>
<p dir="auto">Where NYSE_dates.txt is simply a list of dates (could be anything really):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="7/5/1962
7/6/1962
7/9/1962
...
12/29/2020
12/30/2020
12/31/2020"><pre class="notranslate"><code class="notranslate">7/5/1962
7/6/1962
7/9/1962
...
12/29/2020
12/30/2020
12/31/2020
</code></pre></div>
<p dir="auto">Output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[&quot;b'7/5/1962'&quot; &quot;b'7/6/1962'&quot; &quot;b'7/9/1962'&quot; ..., &quot;b'12/29/2020'&quot;
 &quot;b'12/30/2020'&quot; &quot;b'12/31/2020'&quot;]"><pre class="notranslate"><code class="notranslate">["b'7/5/1962'" "b'7/6/1962'" "b'7/9/1962'" ..., "b'12/29/2020'"
 "b'12/30/2020'" "b'12/31/2020'"]
</code></pre></div>
<p dir="auto">As you can see, all the strings have been bytes-casted, then stringified through <code class="notranslate">conv</code>, as you would get the same result from <code class="notranslate">str(str('12/31/2020').encode('latin1'))</code>, per <code class="notranslate">conv</code> &amp; <code class="notranslate">compat.asbytes</code>.</p>
<p dir="auto">After looking at the code, it appears that all strings are bytes-casted with <code class="notranslate">asbytes(...)</code> pretty much throughout, as for example in <code class="notranslate">split_line(...)</code>, so this must mean every routine in the module is broken.</p>