[issue39681] pickle.load expects an object that implements readinto

2020-02-24 Thread Nathan Goldbaum
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/issue39

[issue39681] pickle.load expects an object that implements readinto

2020-02-19 Thread Nathan Goldbaum
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/blob

[issue39681] pickle.load expects an object that implements readinto

2020-02-19 Thread Nathan Goldbaum
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

[issue39681] pickle.load expects an object that implements readinto

2020-02-18 Thread Nathan Goldbaum
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

[issue32543] odd floor division behavior

2018-01-12 Thread Nathan Goldbaum
New submission from Nathan Goldbaum <nathan12...@gmail.com>: 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 a