numpy/numpy — pull request #4649 by alanbriolat (2014-04-29 10:32:51+00:00)
Title: Fix np.genfromtxt field name handling when dtype != None

``np.genfromtxt`` validates field names twice: once in ``genfromtxt`` and once in ``easy_dtype``. Whilst the arguments to ``genfromtxt`` are used in the first validation, they aren't passed to ``easy_dtype`` (which is used only when ``dtype != None``) and therefore in this case the default validation (strip non-alphanum, replace spaces) gets confusingly applied, ignoring ``genfromtxt``'s arguments.

This patch adds failing tests for the issue and fixes ``genfromtxt`` by passing the appropriate arguments onwards to ``easy_dtype``.

This is probably the least invasive way to fix the issue. In my opinion, the whole thing is a nest of poorly-defined responsibilities between ``genfromtxt``, ``easy_dtype`` and ``NameValidator``, especially since the latter two are only used in the former. I'm willing to take the time to try and clean that up if it's likely to be well-received.