bug? file.write('\n') produces a carriage return and a line feed

2005-12-14 Thread jcb
The following code in Python 2.3
f = file('t.txt', 'wt')
f.write('\n')
f.close()

writes
0D0A  to the file.

Is this a bug or expected behavior?
It sure took me by surprise.

If it is not a bug, is this behavior documented?

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


Re: bug? file.write('\n') produces a carriage return and a line feed

2005-12-14 Thread jcb
Thanks much.

Yes, I am using Windows.

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