How to test if a file has been created by pickle?

后端 未结 2 1150
没有蜡笔的小新
没有蜡笔的小新 2021-02-18 18:37

Is there any way of checking if a file has been created by pickle? I could just catch exceptions thrown by pickle.load but there is no specific \"not a

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-18 18:52

    There is no sure way other than to try to unpickle it, and catch exceptions.

提交回复
热议问题