~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/library/rexec.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
           elif mode in ('w', 'wb', 'a', 'ab'):
273
273
               # check filename : must begin with /tmp/
274
274
               if file[:5]!='/tmp/':
275
 
                   raise IOError, "can't write outside /tmp"
 
275
                   raise IOError("can't write outside /tmp")
276
276
               elif (string.find(file, '/../') >= 0 or
277
277
                    file[:3] == '../' or file[-3:] == '/..'):
278
 
                   raise IOError, "'..' in filename forbidden"
279
 
           else: raise IOError, "Illegal open() mode"
 
278
                   raise IOError("'..' in filename forbidden")
 
279
           else: raise IOError("Illegal open() mode")
280
280
           return open(file, mode, buf)
281
281
 
282
282
Notice that the above code will occasionally forbid a perfectly valid filename;