8000 ENH: Improve support for pathlib.Path objects in load functions by paulmueller · Pull Request #11348 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Improve support for pathlib.Path objects in load functions #11348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 1, 2018
Prev Previous commit
Next Next commit
tests: fix permission error on windows (memmap file not closed)
  • Loading branch information
paulmueller committed Oct 31, 2018
commit d2d15719973315c8271b47935a2a2e1c29bed465
1 change: 1 addition & 0 deletions numpy/lib/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,7 @@ def test_save_load_memmap(self):
np.save(path, a)
data = np.load(path, mmap_mode='r')
assert_array_equal(data, a)
del data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for this line? A comment might be nice

Copy link
Contributor Author
@paulmueller paulmueller Oct 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required such that numpy closes the mem-mapped file. Otherwise you will get weird errors on Windows.


def test_save_load_memmap_readwrite(self):
# Test that pathlib.Path instances can be written mem-mapped.
Expand Down
0