Python pickle: fix \r characters before loading

前端 未结 4 1742
忘掉有多难
忘掉有多难 2021-01-02 13:38

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 14:08

    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?

提交回复
热议问题