Nathan Goldbaum <nathan12...@gmail.com> 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,
 in particular the usage of FilelikeMock with has_readinto set to False.

This goes back to https://github.com/pytorch/pytorch/pull/5466, however I'm not 
sure offhand why it was decided to explicitly test file-like objects that don't 
implement readinto. I don't know how many consumers there are for this API in 
pytorch, but there is at least one user who has reported an error traceback 
caused by this change. I'm hoping to hear more to see whether there are any 
libraries that depend on pytorch and are implicitly depending on this 
functionality.

Googling the error message that Python3.8 emits in this situation also leads me 
to this bug report in a different library: 
https://github.com/web2py/py4web/issues/77

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39681>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to