Hi Vincent, On 2019-09-03, Vincent Delecroix <20100.delecr...@gmail.com> wrote: >> In fact it isn't compatible, but that of course means it must be >> attempted to make it compatible. > > It is already compatible. You just need to specify which kind of > data has been pickled ('bytes' vs 'str')
I disagree. When you pickle a Python-2 str and unpickle with Python-3, you get a Python-3 str. And that's a problem, as Python-2 str corresponds to Python-3 bytes, whereas Python-3 str corresponds to Python-2 unicode. Moreover, the attempt to unpickle a Python-2 str as a Python-3 str can fail. Of course it is possible that you tell Python-3 to unpickle Python-2 str as bytes (namely by pickle.load(<file>, encoding="bytes")). But can we really say that things are *compatible* if an apple (Python-2 str) is unpickled as a banana (Python-3 str)? And can we really say that things *are* compatible when compatibility can only be achieved by providing an optional keyword argument? Anyway. After I learned about the `encoding` keyword, I opened #28444, where I propose to add the `encoding` keyword to Sage's `load` function, so that it can be passed to pickle.load. Best regards, Simon -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/qkm69r%241593%241%40blaine.gmane.org.