Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

Location:
python/vendor/current/Doc/using
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Doc/using/cmdline.rst

    r2 r388  
    11.. highlightlang:: none
     2
     3.. ATTENTION: You probably should update Misc/python.man, too, if you modify
     4.. this file.
    25
    36.. _using-on-general:
     
    2225When invoking Python, you may specify any of these options::
    2326
    24     python [-BdEiOQsStuUvVWxX3?] [-c command | -m module-name | script | - ] [args]
     27    python [-BdEiOQsRStuUvVWxX3?] [-c command | -m module-name | script | - ] [args]
    2528
    2629The most common use case is, of course, a simple invocation of a script::
     
    5962.. cmdoption:: -c <command>
    6063
    61    Execute the Python code in *command*.  *command* can be one ore more
     64   Execute the Python code in *command*.  *command* can be one or more
    6265   statements separated by newlines, with significant leading whitespace as in
    6366   normal module code.
     
    7982   use a name that includes a hyphen).
    8083
     84   Package names are also permitted. When a package name is supplied instead
     85   of a normal module, the interpreter will execute ``<pkg>.__main__`` as
     86   the main module. This behaviour is deliberately similar to the handling
     87   of directories and zipfiles that are passed to the interpreter as the
     88   script argument.
     89
    8190   .. note::
    8291
     
    98107   .. seealso::
    99108      :func:`runpy.run_module`
    100          The actual implementation of this feature.
     109         Equivalent functionality directly available to Python code
    101110
    102111      :pep:`338` -- Executing modules as scripts
     
    106115   .. versionchanged:: 2.5
    107116      The named module can now be located inside a package.
     117
     118   .. versionchanged:: 2.7
     119      Supply the package name to run a ``__main__`` submodule.
     120      sys.argv[0] is now set to ``"-m"`` while searching for the module
     121      (it was previously incorrectly set to ``"-c"``)
    108122
    109123
     
    240254
    241255
     256.. cmdoption:: -R
     257
     258   Turn on hash randomization, so that the :meth:`__hash__` values of str,
     259   bytes and datetime objects are "salted" with an unpredictable random value.
     260   Although they remain constant within an individual Python process, they are
     261   not predictable between repeated invocations of Python.
     262
     263   This is intended to provide protection against a denial-of-service caused by
     264   carefully-chosen inputs that exploit the worst case performance of a dict
     265   construction, O(n^2) complexity.  See
     266   http://www.ocert.org/advisories/ocert-2011-003.html for details.
     267
     268   Changing hash values affects the order in which keys are retrieved from a
     269   dict.  Although Python has never made guarantees about this ordering (and it
     270   typically varies between 32-bit and 64-bit builds), enough real-world code
     271   implicitly relies on this non-guaranteed behavior that the randomization is
     272   disabled by default.
     273
     274   See also :envvar:`PYTHONHASHSEED`.
     275
     276   .. versionadded:: 2.6.8
     277
     278
    242279.. cmdoption:: -s
    243280
    244    Don't add user site directory to sys.path
     281   Don't add the :data:`user site-packages directory <site.USER_SITE>` to
     282   :data:`sys.path`.
    245283
    246284   .. versionadded:: 2.6
     
    301339   :option:`-W` options are ignored (though, a warning message is printed about
    302340   invalid options when the first warning is issued).
     341
     342   Starting from Python 2.7, :exc:`DeprecationWarning` and its descendants
     343   are ignored by default.  The :option:`-Wd` option can be used to re-enable
     344   them.
    303345
    304346   Warnings can also be controlled from within a Python program using the
     
    332374   may be omitted.  The *message* field matches the start of the warning message
    333375   printed; this match is case-insensitive.  The *category* field matches the
    334    warning category.  This must be a class name; the match test whether the
     376   warning category.  This must be a class name; the match tests whether the
    335377   actual warning category of the message is a subclass of the specified warning
    336378   category.  The full class name must be given.  The *module* field matches the
     
    343385
    344386      :pep:`230` -- Warning framework
     387
     388      :envvar:`PYTHONWARNINGS`
    345389
    346390
     
    399443---------------------
    400444
    401 These environment variables influence Python's behavior.
     445These environment variables influence Python's behavior, they are processed
     446before the command-line switches other than -E.  It is customary that
     447command-line switches override environmental variables where there is a
     448conflict.
    402449
    403450.. envvar:: PYTHONHOME
     
    492539
    493540   If this is set, Python ignores case in :keyword:`import` statements.  This
    494    only works on Windows.
     541   only works on Windows, OS X, OS/2, and RiscOS.
    495542
    496543
     
    498545
    499546   If this is set, Python won't try to write ``.pyc`` or ``.pyo`` files on the
    500    import of source modules.
     547   import of source modules.  This is equivalent to specifying the :option:`-B`
     548   option.
    501549
    502550   .. versionadded:: 2.6
     551
     552.. envvar:: PYTHONHASHSEED
     553
     554   If this variable is set to ``random``, the effect is the same as specifying
     555   the :option:`-R` option: a random value is used to seed the hashes of str,
     556   bytes and datetime objects.
     557
     558   If :envvar:`PYTHONHASHSEED` is set to an integer value, it is used as a
     559   fixed seed for generating the hash() of the types covered by the hash
     560   randomization.
     561
     562   Its purpose is to allow repeatable hashing, such as for selftests for the
     563   interpreter itself, or to allow a cluster of python processes to share hash
     564   values.
     565
     566   The integer must be a decimal number in the range [0,4294967295].
     567   Specifying the value 0 will lead to the same hash values as when hash
     568   randomization is disabled.
     569
     570   .. versionadded:: 2.6.8
     571
    503572
    504573.. envvar:: PYTHONIOENCODING
     
    513582.. envvar:: PYTHONNOUSERSITE
    514583
    515    If this is set, Python won't add the user site directory to sys.path
     584   If this is set, Python won't add the :data:`user site-packages directory
     585   <site.USER_SITE>` to :data:`sys.path`.
    516586
    517587   .. versionadded:: 2.6
     
    524594.. envvar:: PYTHONUSERBASE
    525595
    526    Sets the base directory for the user site directory
     596   Defines the :data:`user base directory <site.USER_BASE>`, which is used to
     597   compute the path of the :data:`user site-packages directory <site.USER_SITE>`
     598   and :ref:`Distutils installation paths <inst-alt-install-user>` for ``python
     599   setup.py install --user``.
    527600
    528601   .. versionadded:: 2.6
     
    539612   Mac OS X.
    540613
     614.. envvar:: PYTHONWARNINGS
     615
     616   This is equivalent to the :option:`-W` option. If set to a comma
     617   separated string, it is equivalent to specifying :option:`-W` multiple
     618   times.
     619
    541620
    542621Debug-mode variables
     
    544623
    545624Setting these variables only has an effect in a debug build of Python, that is,
    546 if Python was configured with the :option:`--with-pydebug` build option.
     625if Python was configured with the ``--with-pydebug`` build option.
    547626
    548627.. envvar:: PYTHONTHREADDEBUG
     
    563642   If set, Python will print memory allocation statistics every time a new
    564643   object arena is created, and on shutdown.
    565 
  • python/vendor/current/Doc/using/index.rst

    r2 r388  
    11.. _using-index:
    22
    3 ################
    4   Using Python
    5 ################
     3##########################
     4  Python Setup and Usage
     5##########################
    66
    77
  • python/vendor/current/Doc/using/mac.rst

    r2 r388  
    2626================================
    2727
    28 Mac OS X 10.5 comes with Python 2.5.1 pre-installed by Apple.  If you wish, you
     28Mac OS X 10.8 comes with Python 2.7 pre-installed by Apple.  If you wish, you
    2929are invited to install the most recent version of Python from the Python website
    3030(http://www.python.org).  A current "universal binary" build of Python, which
     
    3333What you get after installing is a number of things:
    3434
    35 * A :file:`MacPython 2.5` folder in your :file:`Applications` folder. In here
     35* A :file:`MacPython 2.7` folder in your :file:`Applications` folder. In here
    3636  you find IDLE, the development environment that is a standard part of official
    3737  Python distributions; PythonLauncher, which handles double-clicking Python
     
    7575:program:`TextMate` (see http://macromates.com/). Other editors include
    7676:program:`Gvim` (http://macvim.org) and :program:`Aquamacs`
    77 (http://aquamacs.org).
     77(http://aquamacs.org/).
    7878
    7979To run your script from the Terminal window you must make sure that
     
    101101instead of :program:`python` to start such scripts.
    102102
    103 With Python 2.5, you can use either :program:`python` or :program:`pythonw`.
     103With Python 2.7, you can use either :program:`python` or :program:`pythonw`.
    104104
    105105
     
    123123
    124124MacPython ships with the standard IDLE development environment. A good
    125 introduction to using IDLE can be found at http://hkn.eecs.berkeley.edu/
    126 dyoo/python/idle_intro/index.html.
     125introduction to using IDLE can be found at
     126http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html.
    127127
    128128
     
    134134There are several methods to install additional Python packages:
    135135
    136 * http://pythonmac.org/packages/ contains selected compiled packages for Python
    137   2.5, 2.4, and 2.3.
    138 
    139136* Packages can be installed via the standard Python distutils mode (``python
    140137  setup.py install``).
    141138
    142 * Many packages can also be installed via the :program:`setuptools` extension.
     139* Many packages can also be installed via the :program:`setuptools` extension
     140  or :program:`pip` wrapper, see http://www.pip-installer.org/.
    143141
    144142
     
    168166===========================================
    169167
    170 The "Build Applet" tool that is placed in the MacPython 2.5 folder is fine for
     168The "Build Applet" tool that is placed in the MacPython 2.7 folder is fine for
    171169packaging small Python scripts on your own machine to run as a standard Mac
    172170application. This tool, however, is not robust enough to distribute Python
     
    176174:program:`py2app`. More information on installing and using py2app can be found
    177175at http://undefined.org/python/#py2app.
    178 
    179 
    180 Application Scripting
    181 =====================
    182 
    183 Python can also be used to script other Mac applications via Apple's Open
    184 Scripting Architecture (OSA); see http://appscript.sourceforge.net. Appscript is
    185 a high-level, user-friendly Apple event bridge that allows you to control
    186 scriptable Mac OS X applications using ordinary Python scripts. Appscript makes
    187 Python a serious alternative to Apple's own *AppleScript* language for
    188 automating your Mac. A related package, *PyOSA*, is an OSA language component
    189 for the Python scripting language, allowing Python code to be executed by any
    190 OSA-enabled application (Script Editor, Mail, iTunes, etc.). PyOSA makes Python
    191 a full peer to AppleScript.
    192176
    193177
  • python/vendor/current/Doc/using/unix.rst

    r2 r388  
    1 .. highlightlang:: none
     1.. highlightlang:: sh
    22
    33.. _using-on-unix:
     
    2727.. seealso::
    2828
    29    http://www.linux.com/articles/60383
     29   http://www.debian.org/doc/manuals/maint-guide/first.en.html
    3030      for Debian users
    31    http://linuxmafia.com/pub/linux/suse-linux-internals/chapter35.html
     31   http://en.opensuse.org/Portal:Packaging
    3232      for OpenSuse users
    33    http://docs.fedoraproject.org/drafts/rpm-guide-en/ch-creating-rpms.html
     33   http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-creating-rpms.html
    3434      for Fedora users
    3535   http://www.slackbook.org/html/package-management-making-packages.html
     
    5656--------------
    5757
    58 To install the newest Python versions on OpenSolaris, install blastwave
    59 (http://www.blastwave.org/howto.html) and type "pkg_get -i python" at the
     58To install the newest Python versions on OpenSolaris, install `blastwave
     59<http://www.blastwave.org/howto.html>`_ and type ``pkg_get -i python`` at the
    6060prompt.
    6161
     
    6666If you want to compile CPython yourself, first thing you should do is get the
    6767`source <http://python.org/download/source/>`_. You can download either the
    68 latest release's source or just grab a fresh `checkout
    69 <http://www.python.org/dev/faq/#how-do-i-get-a-checkout-of-the-repository-read-only-and-read-write>`_.
     68latest release's source or just grab a fresh `clone
     69<http://docs.python.org/devguide/setup#getting-the-source-code>`_.  (If you want
     70to contribute patches, you will need a clone.)
    7071
    71 The build process consists the usual ::
     72The build process consists in the usual ::
    7273
    7374   ./configure
     
    7677
    7778invocations. Configuration options and caveats for specific Unix platforms are
    78 extensively documented in the :file:`README` file in the root of the Python
     79extensively documented in the :source:`README` file in the root of the Python
    7980source tree.
    8081
     
    145146
    146147Geany is an excellent IDE with support for a lot of languages. For more
    147 information, read: http://geany.uvena.de/
     148information, read: http://www.geany.org/
    148149
    149150Komodo edit is another extremely good IDE.  It also has support for a lot of
  • python/vendor/current/Doc/using/windows.rst

    r2 r388  
    4848      by Richard Dooling, 2006
    4949
    50    `Installing on Windows <http://diveintopython.org/installing_python/windows.html>`_
     50   `Installing on Windows <http://diveintopython.net/installing_python/windows.html>`_
    5151      in "`Dive into Python: Python from novice to pro
    52       <http://diveintopython.org/index.html>`_"
     52      <http://diveintopython.net/index.html>`_"
    5353      by Mark Pilgrim, 2004,
    5454      ISBN 1-59059-356-1
     
    8484settings in Windows.
    8585
     86
     87.. _setting-envvars:
    8688
    8789Excursus: Setting environment variables
     
    159161:file:`C:\\Python\\Lib\\site-packages\\`.
    160162
    161 .. `` this fixes syntax highlighting errors in some editors due to the \\ hackery
    162 
    163 You can add folders to your search path to make Python's import mechanism search
    164 in these directories as well.  Use :envvar:`PYTHONPATH`, as described in
    165 :ref:`using-on-envvars`, to modify :data:`sys.path`.  On Windows, paths are
    166 separated by semicolons, though, to distinguish them from drive identifiers
    167 (:file:`C:\\` etc.).
    168 
    169 .. ``
    170 
    171 Modifying the module search path can also be done through the Windows registry:
    172 Edit
    173 :file:`HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\{version}\\PythonPath\\`,
    174 as described above for the environment variable :envvar:`%PYTHONPATH%`.  A
    175 convenient registry editor is :program:`regedit` (start it by typing "regedit"
    176 into :menuselection:`Start --> Run`).
     163This is how :data:`sys.path` is populated on Windows:
     164
     165* An empty entry is added at the start, which corresponds to the current
     166  directory.
     167
     168* If the environment variable :envvar:`PYTHONPATH` exists, as described in
     169  :ref:`using-on-envvars`, its entries are added next.  Note that on Windows,
     170  paths in this variable must be separated by semicolons, to distinguish them
     171  from the colon used in drive identifiers (``C:\`` etc.).
     172
     173* Additional "application paths" can be added in the registry as subkeys of
     174  :samp:`\\SOFTWARE\\Python\\PythonCore\\{version}\\PythonPath` under both the
     175  ``HKEY_CURRENT_USER`` and ``HKEY_LOCAL_MACHINE`` hives.  Subkeys which have
     176  semicolon-delimited path strings as their default value will cause each path
     177  to be added to :data:`sys.path`.  (Note that all known installers only use
     178  HKLM, so HKCU is typically empty.)
     179
     180* If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as
     181  "Python Home".  Otherwise, the path of the main Python executable is used to
     182  locate a "landmark file" (``Lib\os.py``) to deduce the "Python Home".  If a
     183  Python home is found, the relevant sub-directories added to :data:`sys.path`
     184  (``Lib``, ``plat-win``, etc) are based on that folder.  Otherwise, the core
     185  Python path is constructed from the PythonPath stored in the registry.
     186
     187* If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified in
     188  the environment, and no registry entries can be found, a default path with
     189  relative entries is used (e.g. ``.\Lib;.\plat-win``, etc).
     190
     191The end result of all this is:
     192
     193* When running :file:`python.exe`, or any other .exe in the main Python
     194  directory (either an installed version, or directly from the PCbuild
     195  directory), the core path is deduced, and the core paths in the registry are
     196  ignored.  Other "application paths" in the registry are always read.
     197
     198* When Python is hosted in another .exe (different directory, embedded via COM,
     199  etc), the "Python Home" will not be deduced, so the core path from the
     200  registry is used.  Other "application paths" in the registry are always read.
     201
     202* If Python can't find its home and there is no registry (eg, frozen .exe, some
     203  very strange installation setup) you get a path with some default, but
     204  relative, paths.
    177205
    178206
     
    267295`source <http://python.org/download/source/>`_. You can download either the
    268296latest release's source or just grab a fresh `checkout
    269 <http://www.python.org/dev/faq/#how-do-i-get-a-checkout-of-the-repository-read-only-and-read-write>`_.
     297<http://docs.python.org/devguide/setup#checking-out-the-code>`_.
    270298
    271299For Microsoft Visual C++, which is the compiler with which official Python
Note: See TracChangeset for help on using the changeset viewer.