bpo-37502: handle default parameter for buffers argument of pickle.loads correctly (GH-14593)

(cherry picked from commit 898318b53d)

Co-authored-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
Miss Islington (bot) 2019-07-25 09:18:20 -07:00 committed by GitHub
parent 69802f6163
commit 25cb4fd4fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -2765,6 +2765,11 @@ class AbstractPickleTests(unittest.TestCase):
with self.assertRaises(pickle.UnpicklingError):
self.loads(data, buffers=[])
def test_inband_accept_default_buffers_argument(self):
for proto in range(5, pickle.HIGHEST_PROTOCOL + 1):
data_pickled = self.dumps(1, proto, buffer_callback=None)
data = self.loads(data_pickled, buffers=None)
@unittest.skipIf(np is None, "Test needs Numpy")
def test_buffers_numpy(self):
def check_no_copy(x, y):