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


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

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

Started byEvan Driscoll <driscoll@cs.wisc.edu>
First post2012-03-27 16:59 -0500
Last post2012-03-27 16:59 -0500
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 Evan Driscoll <driscoll@cs.wisc.edu> - 2012-03-27 16:59 -0500

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

FromEvan Driscoll <driscoll@cs.wisc.edu>
Date2012-03-27 16:59 -0500
SubjectRe: RE: Advise of programming one of my first programs
Message-ID<mailman.1051.1332885611.3037.python-list@python.org>
On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote:
>> ####### CODE #########
>> fileread = open('myfile.txt','r')
>> tbook = eval(fileread.read())
>> fileread.close()
>
> 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:

   Warning: The pickle module is not intended to be secure
   against erroneous or maliciously constructed data. Never
   unpickle data received from an untrusted or unauthenticated
   source.
             - http://docs.python.org/library/pickle.html


Evan

[toc] | [standalone]


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


csiph-web