Python throws KeyError: \r\n
<p>I'm writing a network authentication program, and when I get to the actual verification part, Python quits with the error "KeyError: \r\n." Why does Python throw a KeyError, of all things, and how can I resolve this? I'm running Python 2.7.2 on Windows 7.
Code:</p>

<pre><code>    client.send("You should enter your username: ")
    uname=client.recv(size)
    client.send("You should also enter your password: ")
    passc=client.recv(size)
    client.send("\r\nI will verify your information.\r\n")
    if users[uname].strip(cr) == passc.strip(cr):
        client.send("It worked, continue...")
    else: client.send("It didn't work\r\n")
</code></pre>

<p>Before this, I wrote a line:</p>

<p><code>client.send("Press return");
cr = client.recv(5)</code></p>

<p>Edit: <em>slaps head</em> The reason it's throwing a key error is that for some reason, it won't let the client set uname. It completely ignores the client.recv there and just skips to the next line.</p>
