Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92369
| References | <ml7a2p$hp$1@ger.gmane.org> <CAMw+j7K7JmRPo3PnzTE2rZEstdZRF085+VA=v1ieMMHk2Gp6mQ@mail.gmail.com> |
|---|---|
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
| Date | 2015-06-09 13:07 -0700 |
| Subject | Re: enhancement request: make py3 read/write py2 pickle format |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.322.1433880494.13271.python-list@python.org> (permalink) |
There's a lot of subtle issues with pickle compatibility. e.g. old-style vs new-style classes. It's kinda hard and it's better to give up. I definitely agree it's better to use something else instead. For example, we switched to using protocol buffers, which have much better compatibility properties and are a bit more testable to boot (since text format protobufs are always output in a canonical (sorted) form.) -- Devin On Tue, Jun 9, 2015 at 11:35 AM, Chris Warrick <kwpolska@gmail.com> wrote: > On Tue, Jun 9, 2015 at 8:08 PM, Neal Becker <ndbecker2@gmail.com> wrote: >> One of the most annoying problems with py2/3 interoperability is that the >> pickle formats are not compatible. There must be many who, like myself, >> often use pickle format for data storage. >> >> It certainly would be a big help if py3 could read/write py2 pickle format. >> You know, backward compatibility? > > Don’t use pickle. It’s unsafe — it executes arbitrary code, which > means someone can give you a pickle file that will delete all your > files or eat your cat. > > Instead, use a safe format that has no ability to execute code, like > JSON. It will also work with other programming languages and > environments if you ever need to talk to anyone else. > > But, FYI: there is backwards compatibility if you ask for it, in the > form of protocol versions. That’s all you should know — again, don’t > use pickle. > > -- > Chris Warrick <https://chriswarrick.com/> > PGP: 5EAAEA16 > -- > https://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-09 13:07 -0700
csiph-web