Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread Jean-Paul Calderone
On Thu, 26 Feb 2009 23:32:13 +0100, jkv wrote: Jean-Paul Calderone wrote: sys.stdout.write('Password: '); #IAC DO ECHO sys.stdout.write('\xFF\xFB\x01') password = raw_input() If the client sends 'qwerty\r\n' everything is fine and the password get stored in the variable. But som

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread jkv
Jean-Paul Calderone wrote: sys.stdout.write('Password: '); #IAC DO ECHO sys.stdout.write('\xFF\xFB\x01') password = raw_input() If the client sends 'qwerty\r\n' everything is fine and the password get stored in the variable. But sometimes, depending on how broken the telnet clien

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread Jean-Paul Calderone
On Thu, 26 Feb 2009 11:46:24 +0100, jkv wrote: Hi, Are there any way to change the EOL character for sys.stdin.readline() and raw_input()? My problem is that i cannot rely on that the clients connection to my application will end all lines with \n or \r\n. Sometimes they will use \r\000 as E

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread jkv
Terry Reedy wrote: jkv wrote: Hi, Are there any way to change the EOL character for sys.stdin.readline() and raw_input()? My problem is that i cannot rely on that the clients connection to my application will end all lines with \n or \r\n. Sometimes they will use \r\000 as EOL. Example fro

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread skip
What is it about with statements that makes you want to so frequently embed them in try/except statements? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread Terry Reedy
jkv wrote: Hi, Are there any way to change the EOL character for sys.stdin.readline() and raw_input()? My problem is that i cannot rely on that the clients connection to my application will end all lines with \n or \r\n. Sometimes they will use \r\000 as EOL. Example from my code: sys.s

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread MRAB
jkv wrote: Hi, Are there any way to change the EOL character for sys.stdin.readline() and raw_input()? My problem is that i cannot rely on that the clients connection to my application will end all lines with \n or \r\n. Sometimes they will use \r\000 as EOL. Example from my code: sys.s

EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread jkv
Hi, Are there any way to change the EOL character for sys.stdin.readline() and raw_input()? My problem is that i cannot rely on that the clients connection to my application will end all lines with \n or \r\n. Sometimes they will use \r\000 as EOL. Example from my code: sys.stdout.write(