Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22259 > unrolled thread

Re: RE: Advise of programming one of my first programs

Started byDevin Jeanpierre <jeanpierreda@gmail.com>
First post2012-03-27 20:26 -0400
Last post2012-03-27 20:26 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: RE: Advise of programming one of my first programs Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-03-27 20:26 -0400

#22259 — Re: RE: Advise of programming one of my first programs

FromDevin Jeanpierre <jeanpierreda@gmail.com>
Date2012-03-27 20:26 -0400
SubjectRe: RE: Advise of programming one of my first programs
Message-ID<mailman.1057.1332894426.3037.python-list@python.org>
On Tue, Mar 27, 2012 at 5:59 PM, Evan Driscoll <driscoll@cs.wisc.edu> wrote:
>> The use of eval is dangerous if you are not *completely* sure what is
>> being passed in. Try using pickle instead:
>> http://docs.python.org/release/2.5.2/lib/pickle-example.html
>
>
> Um, at least by my understanding, the use of Pickle is also dangerous if you
> are not completely sure what is being passed in:

Oh goodness yes. pickle is exactly as unsafe as eval is. Try running this code:

from pickle import loads
loads("c__builtin__\neval\n(c__builtin__\nraw_input\n(S'py>'\ntRtR.")

-- Devin

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web