Python pickle: fix \r characters before loading

后端 未结 4 1326
清歌不尽
清歌不尽 2021-01-02 14:41

I got a pickled object (a list with a few numpy arrays in it) that was created on Windows and apparently saved to a file loaded as text, not in binary mode (ie. with

4条回答
  •  没有蜡笔的小新
    2021-01-02 15:41

    Can't you -- on Windows -- just open the file in text mode, the same way it was written, read it in and then write it out to another file opened properly in binary mode?

提交回复
热议问题