mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue 1267, continued.
Additional patch by Christian Heimes to deal more cleanly with the FILE* vs file-descriptor issues. I cleaned up his code a bit, and moved the lseek() call into import.c.
This commit is contained in:
parent
c2954e5273
commit
40d20bcf1f
12 changed files with 94 additions and 64 deletions
|
@ -44,6 +44,23 @@ class ImportTests(unittest.TestCase):
|
|||
fd = imp.find_module("heapq")[0]
|
||||
self.assertEqual(fd.encoding, "iso-8859-1")
|
||||
|
||||
def test_issue1267(self):
|
||||
fp, filename, info = imp.find_module("pydoc")
|
||||
self.assertNotEqual(fp, None)
|
||||
self.assertEqual(fp.encoding, "iso-8859-1")
|
||||
self.assertEqual(fp.tell(), 0)
|
||||
self.assertEqual(fp.readline(), '#!/usr/bin/env python\n')
|
||||
fp.close()
|
||||
|
||||
fp, filename, info = imp.find_module("tokenize")
|
||||
self.assertNotEqual(fp, None)
|
||||
self.assertEqual(fp.encoding, "utf-8")
|
||||
self.assertEqual(fp.tell(), 0)
|
||||
self.assertEqual(fp.readline(),
|
||||
'"""Tokenization help for Python programs.\n')
|
||||
fp.close()
|
||||
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(
|
||||
LockTests,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue