8000 load does not accept pathlib.Path in mmap_mode · Issue #11342 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

load does not accept pathlib.Path in mmap_mode #11342

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

Closed
paulmueller opened this issue Jun 15, 2018 · 1 comment
Closed

load does not accept pathlib.Path in mmap_mode #11342

paulmueller opened this issue Jun 15, 2018 · 1 comment

Comments

@paulmueller
Copy link
Contributor

#6660, #665, and #6418 added support for pathlib.Path in numpy.load.

However, if mmap_mode is not None in numpy.load, I get an error:

  File ".../python3.6/site-packages/numpy/lib/format.py", line 747, in open_memmap
    raise ValueError("Filename must be a string.  Memmap cannot use"
ValueError: Filename must be a string.  Memmap cannot use existing file handles.

The problem is that format.open_memmap does not yet support pathlib.Path.

https://github.com/numpy/numpy/blob/master/numpy/lib/format.py#L703
https://github.com/numpy/numpy/blob/master/numpy/lib/npyio.py#L430

Please let me know whether you would accept a PR for this.

@seberg
Copy link
Member
seberg commented Jun 15, 2018

Of course we always happy about PRs, if you are not familiar with such workflows, you may want to look at the developer guidelines, but overall, just post the PR and react to the comments!

paulmueller added a commit to paulmueller/numpy that referenced this issue Jun 15, 2018
Add support for pathlib.Path when "mmap_mode" is specified
in np.load "Closes numpy#11342".
Add support for pathlib.Path in np.core.records.fromfile.
paulmueller added a commit to paulmueller/numpy that referenced this issue Oct 31, 2018
Add support for pathlib.Path when "mmap_mode" is specified
in np.load "Closes numpy#11342".
Add support for pathlib.Path in np.core.records.fromfile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0