Christian Heimes added the comment:

I've made a short unit tests which tests a large file with and w/o -*-
coding: -*-. It passes on Linux.

Added file: http://bugs.python.org/file8575/py3k_test_issue1267.patch

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1267>
__________________________________
Index: Lib/test/test_imp.py
===================================================================
--- Lib/test/test_imp.py	(revision 58554)
+++ Lib/test/test_imp.py	(working copy)
@@ -44,6 +44,18 @@
         fd = imp.find_module("heapq")[0]
         self.assertEqual(fd.encoding, "iso-8859-1")
 
+    def test_issue1267(self):
+        fd, filename, info  = imp.find_module("pydoc")
+        self.assertEqual(fd.encoding, "iso-8859-1")
+        self.assertEqual(fd.tell(), 0)
+        self.assertEqual(fd.readline(), '#!/usr/bin/env python\n')
+
+        fd, filename, info = imp.find_module("tokenize")
+        self.assertEqual(fd.encoding, "utf-8")
+        self.assertEqual(fd.tell(), 0)
+        self.assertEqual(fd.readline(), '"""Tokenization help for Python programs.\n')
+       
+
 def test_main():
     test_support.run_unittest(
                 LockTests,
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to