It seems to be impossible to combine \obeyspaces and \read in the following manner:

\newread\myread
\obeyspaces  % Deleting this line removes the error
\myinput


The \tracingall doesn't really help me for understanding the problem.

-
Your example has no \obeyspaces: please edit your example so we can see what you are doing (probably including an example myfile.txt). –  Joseph Wright Jan 6 '13 at 10:03

You just need to preserve normal spaces around the \read syntax:

\newread\myread
{\obeyspaces
}

\bye


00
1 1
2  2
3   3


produces

This is TeX, Version 3.1415926 (TeX Live 2012)
(./rd55.tex
00
1 1
2  2
3   3
)
No pages of output.

-
Thanks for your answer, which answers my question. How could I have found out that I need to preserve "normal" (what is the differences to the \obeyspaces?) spaces around the \read syntax to solve problems like this on my own in the future? –  Penguin Nurse Jan 6 '13 at 12:07
obeyspaces makes space into an active character with a definition similar to ~ so that it always typesets as a real space and is never dropped by the input scanner. spaces around tex primitives need to delimit the arguments but be dropped... not sure where best to learn these things other than asking here (after 25 years of using tex it's not always easy to remember how you pick these things up at the start:-) –  David Carlisle Jan 6 '13 at 12:20
from the TeXbook perhaps? ;-) –  jfbu Jan 6 '13 at 16:20
@jfbu not really. TeXBook, or actually more simply just looking at the plain or latex sources will tell you the definition of \obeyspaces, but it takes some experience to spot the implications of that definition on other macros. –  David Carlisle Jan 6 '13 at 16:29