Pillow+numpy+unittest gives a ResourceWarning: does this indicate a leak?
<p>When I use Pillow (version 3.3.0, installed via pip) on Python3 to load image data into numpy arrays, my unit tests report a <code>ResourceWarning</code>.  The warning occurs, for example, when I run the following script:</p>

<pre><code>#! /usr/bin/env python3

import unittest
import numpy as np
import PIL.Image

def load_image():
    with PIL.Image.open('test.tif') as im:
        return np.array(im)

class TestData(unittest.TestCase):

    def test_PIL(self):
        im = load_image()
        print(im.shape)

unittest.main()
</code></pre>

<p>The output is</p>

<pre><code>./err.py:14: ResourceWarning: unclosed file &lt;_io.BufferedReader name='test.tif'&gt;
  im = load_image()
(420, 580)
.
----------------------------------------------------------------------
Ran 1 test in 0.012s

OK
</code></pre>

<p>(The warning disappears, if I don't wrap the image in a numpy array.)</p>

<p>Does this resource warning indicate a leak in my code (<em>e.g.</em>, do I need to "close" the image file somehow beyond using the <code>with</code> statement)?  Or, if the warning is spurious, how can I disable it?</p>