Patch # 188 by Philip Jenvey.
Make tell() mark CRLF as a newline.
With unit test.
diff --git a/Lib/test/test_univnewlines.py b/Lib/test/test_univnewlines.py
index e91bde7..d6bd646 100644
--- a/Lib/test/test_univnewlines.py
+++ b/Lib/test/test_univnewlines.py
@@ -105,6 +105,13 @@
     NEWLINE = '\r\n'
     DATA = DATA_CRLF
 
+    def test_tell(self):
+        fp = open(test_support.TESTFN, self.READMODE)
+        self.assertEqual(repr(fp.newlines), repr(None))
+        data = fp.readline()
+        pos = fp.tell()
+        self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+
 class TestMixedNewlines(TestGenericUnivNewlines):
     NEWLINE = ('\r', '\n')
     DATA = DATA_MIXED
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 16786f8..271f4cd 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -718,6 +718,7 @@
 		int c;
 		c = GETC(f->f_fp);
 		if (c == '\n') {
+			f->f_newlinetypes |= NEWLINE_CRLF;
 			pos++;
 			f->f_skipnextlf = 0;
 		} else if (c != EOF) ungetc(c, f->f_fp);