"Peter Otten" <__pete...@web.de> wrote in message news:iomla6$p8f$1...@dough.gmane.org...
Frank Millman wrote:

On linux, python 3.2 -

x = input()
xyz
len(x)
3
x
'xyz'

on windows, python 3.2 -

x = input()
xyz
len(x)
4
x
'xyz\r'

Is this expected behaviour?

No, that's a bug:

http://bugs.python.org/issue11272

IMO it's severe enough to warrant a brown-bag release...


Thanks, Peter.

I guess I should have checked the bug tracker first.

FWIW, I have found a workaround that seems to work on both platforms -

x = input().rstrip()
xyz
len(x)
3
x
'xyz'

Obviously this will also strip trailing spaces, but it will do for my purposes.

Frank


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to