Nathan Goldbaum added the comment:
Thank you for the fix! Yes I'm planning to file an issue with flair about this
and patch this use case in PyTorch itself.
--
___
Python tracker
<https://bugs.python.org/is
Nathan Goldbaum added the comment:
So I *think* I've pieced together what caused the user crash that originated in
the flair library. It turns out that pickle.load, via torch.load, is getting
passed an mmap.mmap.
https://github.com/flairNLP/flair
Nathan Goldbaum added the comment:
In this case the tests are explicitly testing that a file-like object that does
not implement readinto works with torch.load (which is using pickles under the
hood). See
https://github.com/pytorch/pytorch/blob/master/test/test_serialization.py#L416-L429
New submission from Nathan Goldbaum :
As of https://github.com/python/cpython/pull/7076, it looks like at least the C
implementation of pickle.load expects the file argument to implement readinto:
https://github.com/python/cpython/blob/ffd9753a944916ced659b2c77aebe66a6c9fbab5/Modules
New submission from Nathan Goldbaum :
According to PEP 238:
"floor division will be implemented in all the Python numeric types, and will
have the semantics of:
a // b == floor(a/b)
except that the result type will be the common type into which a and b are
coerced before the oper