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


Groups > comp.lang.python > #22254

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

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <driscoll@cs.wisc.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.073
X-Spam-Evidence '*H*': 0.85; '*S*': 0.00; 'cc:addr:python-list': 0.15; 'eval': 0.16; 'subject:programming': 0.16; 'module': 0.18; 'passed': 0.20; 'wrote:': 0.21; 'header:In-Reply-To:1': 0.22; 'header:User-Agent:1': 0.23; 'cc:addr:python.org': 0.27; 'least': 0.27; 'pm,': 0.28; 'source.': 0.29; 'code': 0.29; 'to:2**1': 0.30; 'cc:2**0': 0.31; 'in.': 0.33; 'in:': 0.33; 'url:python': 0.34; 'sure': 0.36; 'url:library': 0.36; 'url:org': 0.36; 'data': 0.38; 'skip:0 10': 0.38; 'being': 0.39; 'secure': 0.61; 'url:5': 0.67; 'url:release': 0.84
Date Tue, 27 Mar 2012 16:59:58 -0500
From Evan Driscoll <driscoll@cs.wisc.edu>
User-Agent Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version 1.0
To "Prasad, Ramit" <ramit.prasad@jpmorgan.com>
Subject Re: RE: Advise of programming one of my first programs
References <CAKhY55OL1qvq+kqbyKT8gEuFOK4BkgYGZkkyUVb84_H9VVEQhA@mail.gmail.com> <5B80DD153D7D744689F57F4FB69AF4740928C365@SCACMX008.exchad.jpmchase.net> <CAKhY55O9zE_jxF5PvzOF0DGifRT2gZLbRHiuQ_a1vA-aGGDb9g@mail.gmail.com> <5B80DD153D7D744689F57F4FB69AF4740928E137@SCACMX008.exchad.jpmchase.net>
In-Reply-To <5B80DD153D7D744689F57F4FB69AF4740928E137@SCACMX008.exchad.jpmchase.net>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Seen-By mailfromd 4.1 sandstone.cs.wisc.edu
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1051.1332885611.3037.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332885612 news.xs4all.nl 6920 [2001:888:2000:d::a6]:33046
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22254

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: RE: Advise of programming one of my first programs Evan Driscoll <driscoll@cs.wisc.edu> - 2012-03-27 16:59 -0500

csiph-web