[Scipy-tickets] [SciPy] #1385: Python 3.2 "ResourceWarning: unclosed file" during scipy.test()

SciPy Trac scipy-tickets@scipy....
Mon Feb 14 00:03:35 CST 2011


#1385: Python 3.2 "ResourceWarning: unclosed file" during scipy.test()
----------------------+-----------------------------------------------------
 Reporter:  cjgohlke  |       Owner:  somebody
     Type:  defect    |      Status:  new     
 Priority:  normal    |   Milestone:  0.9.0   
Component:  Other     |     Version:  0.8.0   
 Keywords:            |  
----------------------+-----------------------------------------------------
 Running scipy 0.9rc3 test() on Python 3.2rc3 results in many
 ResourceWarning warnings.

 See <http://docs.python.org/dev/whatsnew/3.2.html> and
 <http://bugs.python.org/issue10093> for details about ResourceWarning.

 The attached patch fixes most of these warnings.

 {{{
 C:\Python32\lib\site-packages\nose\loader.py:232: ResourceWarning:
 unclosed file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\io\\matlab\\tests\\data\\test_skip_variable.mat'>
   for test in g():
 C:\Python32\lib\site-packages\scipy\io\matlab\tests\test_mio.py:723:
 ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Python32\\lib
 \\site-packages\\scipy\\io\\matlab\\tests\\data\\single_empty_string.mat'>
   rdr = MatFile5Reader_future(stream)
 C:\Python32\lib\site-packages\nose\loader.py:232: ResourceWarning:
 unclosed file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\io\\matlab\\tests\\data\\testfunc_7.4_GLNX86.mat'>
   for test in g():
 C:\Python32\lib\site-packages\scipy\io\matlab\tests\test_mio.py:765:
 ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Python32\\lib
 \\site-packages\\scipy\\io\\matlab\\tests\\data\\testmatrix_6.1_SOL2.mat'>
   rdr = MatFile5Reader_future(open(double_eg, 'rb'), mat_dtype=True)
 C:\Python32\lib\site-packages\nose\loader.py:232: ResourceWarning:
 unclosed file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\io\\matlab\\tests\\data\\testmatrix_6.1_SOL2.mat'>
   for test in g():
 C:\Python32\lib\site-packages\scipy\io\matlab\mio5.py:190:
 ResourceWarning: unclosed file<_io.BufferedReader name='C:\\Python32\\lib
 \\site-packages\\scipy\\io\\matlab\\tests\\data\\parabola.mat'>
   self._file_reader = VarReader5(self)
 C:\Python32\lib\unittest\case.py:574: ResourceWarning: unclosed file
 <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\io\\tests\\data\\example_1.nc'>
   callableObj(*args, **kwargs)
 C:\Python32\lib\site-packages\PIL\Image.py:524: ResourceWarning: unclosed
 file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\misc\\tests\\data\\icon.png'>
   self.load()
 C:\Python32\lib\site-packages\PIL\Image.py:524: ResourceWarning: unclosed
 file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\misc\\tests\\data\\icon_mono.png'>
   self.load()
 C:\Python32\lib\site-packages\PIL\Image.py:524: ResourceWarning: unclosed
 file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\misc\\tests\\data\\icon_mono_flat.png'>
   self.load()
 C:\Python32\lib\site-packages\PIL\Image.py:524: ResourceWarning: unclosed
 file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\ndimage\\tests\\dots.png'>
   self.load()
 C:\Python32\lib\site-packages\PIL\Image.py:683: ResourceWarning: unclosed
 file <_io.BufferedReader name='C:\\Python32\\lib\\site-
 packages\\scipy\\ndimage\\tests\\dots.png'>
   self.load()
 C:\Python32\lib\site-
 packages\scipy\spatial\tests\test_distance.py:91:ResourceWarning: unclosed
 file <_io.TextIOWrapper name='C:\\Python32\\lib\\site-
 packages\\scipy\\spatial\\tests\\iris.txt' mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\cdist-X1.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\cdist-X2.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-hamming-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-boolean-inp.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-jaccard-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-cityblock-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-minkowski-3.2-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-cityblock-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-correlation-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-minkowski-5.8-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-correlation-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-minkowski-3.2-ml.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-cosine-ml-iris.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-seuclidean-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-cosine-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-seuclidean-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-double-inp.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-spearman-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-euclidean-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-euclidean-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-chebychev-ml.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\pdist-chebychev-ml-iris.txt'
 mode='r' encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 C:\Python32\lib\site-packages\scipy\spatial\tests\test_distance.py:91:
 ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Python32\\lib
 \\site-packages\\scipy\\spatial\\tests\\random-bool-data.txt' mode='r'
 encoding='cp1252'>
   eo[name] = np.loadtxt(open(fqfn))
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1385>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list