~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Doc/using/cmdline.rst

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
When invoking Python, you may specify any of these options::
26
26
 
27
 
    python [-bBdEhiOsSuvVWx?] [-c command | -m module-name | script | - ] [args]
 
27
    python [-bBdEhiORqsSuvVWx?] [-c command | -m module-name | script | - ] [args]
28
28
 
29
29
The most common use case is, of course, a simple invocation of a script::
30
30
 
227
227
   .. versionadded:: 3.2
228
228
 
229
229
 
 
230
.. cmdoption:: -R
 
231
 
 
232
   Turn on hash randomization, so that the :meth:`__hash__` values of str, bytes
 
233
   and datetime objects are "salted" with an unpredictable random value.
 
234
   Although they remain constant within an individual Python process, they are
 
235
   not predictable between repeated invocations of Python.
 
236
 
 
237
   This is intended to provide protection against a denial-of-service caused by
 
238
   carefully-chosen inputs that exploit the worst case performance of a dict
 
239
   construction, O(n^2) complexity.  See
 
240
   http://www.ocert.org/advisories/ocert-2011-003.html for details.
 
241
 
 
242
   Changing hash values affects the order in which keys are retrieved from a
 
243
   dict.  Although Python has never made guarantees about this ordering (and it
 
244
   typically varies between 32-bit and 64-bit builds), enough real-world code
 
245
   implicitly relies on this non-guaranteed behavior that the randomization is
 
246
   disabled by default.
 
247
 
 
248
   See also :envvar:`PYTHONHASHSEED`.
 
249
 
 
250
   .. versionadded:: 3.2.3
 
251
 
 
252
 
230
253
.. cmdoption:: -s
231
254
 
232
255
   Don't add the :data:`user site-packages directory <site.USER_SITE>` to
247
270
 
248
271
   Force the binary layer of the stdin, stdout and stderr streams (which is
249
272
   available as their ``buffer`` attribute) to be unbuffered.  The text I/O
250
 
   layer will still be line-buffered.
 
273
   layer will still be line-buffered if writing to the console, or
 
274
   block-buffered if redirected to a non-interactive file.
251
275
 
252
276
   See also :envvar:`PYTHONUNBUFFERED`.
253
277
 
349
373
 
350
374
.. _Jython: http://jython.org
351
375
 
 
376
 
352
377
.. _using-on-envvars:
353
378
 
354
379
Environment variables
447
472
.. envvar:: PYTHONCASEOK
448
473
 
449
474
   If this is set, Python ignores case in :keyword:`import` statements.  This
450
 
   only works on Windows.
 
475
   only works on Windows, OS X, and OS/2.
451
476
 
452
477
 
453
478
.. envvar:: PYTHONDONTWRITEBYTECODE
454
479
 
455
480
   If this is set, Python won't try to write ``.pyc`` or ``.pyo`` files on the
456
 
   import of source modules.
 
481
   import of source modules.  This is equivalent to specifying the :option:`-B`
 
482
   option.
 
483
 
 
484
 
 
485
.. envvar:: PYTHONHASHSEED
 
486
 
 
487
   If this variable is set to ``random``, the effect is the same as specifying
 
488
   the :option:`-R` option: a random value is used to seed the hashes of str,
 
489
   bytes and datetime objects.
 
490
 
 
491
   If :envvar:`PYTHONHASHSEED` is set to an integer value, it is used as a fixed
 
492
   seed for generating the hash() of the types covered by the hash
 
493
   randomization.
 
494
 
 
495
   Its purpose is to allow repeatable hashing, such as for selftests for the
 
496
   interpreter itself, or to allow a cluster of python processes to share hash
 
497
   values.
 
498
 
 
499
   The integer must be a decimal number in the range [0,4294967295].  Specifying
 
500
   the value 0 will lead to the same hash values as when hash randomization is
 
501
   disabled.
 
502
 
 
503
   .. versionadded:: 3.2.3
457
504
 
458
505
 
459
506
.. envvar:: PYTHONIOENCODING