Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_compileall.EncodingTest Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_error

Public Attributes

 directory
 source_path

Detailed Description

Issue 6716: compileall should escape source code when printing errors
to stdout.

Definition at line 111 of file test_compileall.py.


Member Function Documentation

Definition at line 115 of file test_compileall.py.

00115 
00116     def setUp(self):
00117         self.directory = tempfile.mkdtemp()
00118         self.source_path = os.path.join(self.directory, '_test.py')
00119         with open(self.source_path, 'w', encoding='utf-8') as file:
00120             file.write('# -*- coding: utf-8 -*-\n')
00121             file.write('print u"\u20ac"\n')

Here is the caller graph for this function:

Definition at line 122 of file test_compileall.py.

00122 
00123     def tearDown(self):
00124         shutil.rmtree(self.directory)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 125 of file test_compileall.py.

00125 
00126     def test_error(self):
00127         try:
00128             orig_stdout = sys.stdout
00129             sys.stdout = io.TextIOWrapper(io.BytesIO(),encoding='ascii')
00130             compileall.compile_dir(self.directory)
00131         finally:
00132             sys.stdout = orig_stdout
00133 

Here is the call graph for this function:


Member Data Documentation

Definition at line 116 of file test_compileall.py.

Definition at line 117 of file test_compileall.py.


The documentation for this class was generated from the following file: