<commit_before>Content-type: text/x-rst
Title: Frequently Asked Questions for Python Developers

:Title: Frequently Asked Questions for Python Developers
:Date: $Date: 2010-09-15 07:35:08 -0700 (Wed, 15 Sep 2010) $
:Version: $Revision: 10931 $
:Web site: http://www.python.org/dev/faq/

.. contents:: :depth: 3
.. sectnum::

General Information
=====================================================================


How can I become a developer?
---------------------------------------------------------------------------

Contribute on a regular basis through patches and ask for commit
privileges once you have demonstrated a track record of being good
at fixing things.

(<NAME> commented on the
`School of Hard Knocks <http://mail.python.org/pipermail/python-dev/2002-September/028725.html>`_ required.)



Version Control
==================================


What do I need to use Subversion?
-------------------------------------------------------------------------------

.. _download Subversion: http://subversion.apache.org/packages.html

UNIX
'''''''''''''''''''

If you have checkin rights, you need OpenSSH_.  This is needed to verify
your identity when performing commits.

.. _OpenSSH: http://www.openssh.org/

Windows
'''''''''''''''''''

If you have checkin rights, you will also need an SSH client.
`Download PuTTY and friends`_ (PuTTYgen, Pageant, and Plink) for this.  All
other questions in this FAQ will assume you are using these tools.

Once you have both Subversion and PuTTY installed you must tell Subversion
where to find an SSH client.  Do this by editing
``%APPDATA%\Subversion\config`` to have the following
section::

  [tunnels]
  ssh="c:/path/to/putty/plink.exe" -T

Change the path to be the proper one for your system.  The ``-T``
option prevents a pseudo-terminal from being created.

You can use Pageant to prevent from having to type in your password for your
SSH 2 key constantly.  If you prefer not to have another program running,
you need to create a profile in PuTTY.

Go to Session:Saved Sessions and create a new profile named
``svn.python.org``.  In Session:Host Name, enter ``svn.python.org``.  In
SSH/Auth:Private key file select your private key.  In Connection:Auto-login
username enter ``pythondev``.

With this set up, paths are slightly different than most other settings in that
the username is not required.  Do take notice of this when choosing to check
out a project!

.. _download TortoiseSVN: http://tortoisesvn.net/downloads
.. _PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/
.. _download PuTTY and friends: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


How do I get a checkout of the repository (read-only or read-write)?
-------------------------------------------------------------------------------

For a read-write checkout (with a caveat for Windows users using PuTTY without
Pageant), the format for ``<URL>`` is::

 svn+ssh://pythondev@svn.python.org/<path>

There are three critical differences between a read-only URL and a read-write
URL.  One is the protocol being specified as ``svn+ssh`` and not ``http``.
Next, the username ``pythondev`` is added (*note* that
Windows users using PuTTY without Pageant should leave off ``pythondev@`` if
PuTTY was set up following the instructions in this FAQ).  Lastly, note that
``projects`` was removed from the path entirely for a read-write checkout.

The repositories most people will be interested in are:

=========== ============================================================== ==========================================================================
Repository  read-only                                                      read-write
----------- -------------------------------------------------------------- --------------------------------------------------------------------------
PEPs        http://svn.python.org/projects/peps/trunk                      svn+ssh://pythondev@svn.python.org/peps/trunk
2.7         http://svn.python.org/projects/python/branches/release27-maint svn+ssh://pythondev@svn.python.org/python/branches/release27-maint
3.1         http://svn.python.org/projects/python/branches/release31-maint svn+ssh://pythondev@svn.python.org/python/branches/release31-maint
3.2         http://svn.python.org/projects/python/branches/py3k            svn+ssh://pythondev@svn.python.org/python/branches/py3k
=========== ============================================================== ==========================================================================



How do I browse the source code through a web browser?
-------------------------------------------------------------------------------

Visit http://svn.python.org/view/ to browse the Subversion repository.


Where can I find a downloadable snapshot of the source code?
-------------------------------------------------------------------------------

Visit http://svn.python.org/snapshots/ to download a tarball containing a daily
snapshot of the repository.


Who has commit privileges on the Subversion repository?
-------------------------------------------------------------------------------

See http://www.python.org/dev/committers for a list of committers.


How do I verify that my commit privileges are working?
-------------------------------------------------------------------------------

UNIX
'''''''''''''''''''

If you are listed as a committer at http://www.python.org/dev/committers , then
you should be able to execute::

  ssh <EMAIL>

and have the following printed to your terminal::

  ( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries
    commit-revprops depth log-revprops partial-replay ) ) )

If something else is printed, then there is a problem with your SSH 2 public
key and you should contact <EMAIL> .

Windows
'''''''''''''''''''

If you are using Pageant, you can verify that your SSH 2 key is set up properly
by running::

  c:\path\to\putty\plink.exe <EMAIL>

Using the proper path to your PuTTY installation, you should get a response
from the server that says::

  ( success ( 1 2 ( ANONYMOUS EXTERNAL ) ( edit-pipeline ) ) )

If there is a failure, run ``plink`` with ``-v`` to analyse the problem.

If you are using a profile in PuTTY, the best way to test is to try to log in
through Open.


What configuration settings should I use?
-------------------------------------------------------------------------------

Make sure the following settings are in your Subversion config file
(``~/.subversion/config`` under UNIX)::

 [miscellany]
 enable-auto-props = yes

 [auto-props]
 * = svn:eol-style=native
 *.c = svn:keywords=Id
 *.h = svn:keywords=Id
 *.py = svn:keywords=Id
 *.txt = svn:keywords=Author Date Id Revision

The ``[auto-props]`` line specifies the beginning of the section in the config
file.  The ``svn:eol-style`` setting tells Subversion to check out files using
the native line endings on your OS.  It will also automatically convert line
endings upon committal so that they are consistent across all platforms.  The
``svn:keywords`` settings are to automatically substitute ``$keyword$``
arguments in files that match the pattern.  ``*.txt`` has more options so as to
cover all needed keywords for PEPs_.

The ``[miscellany]`` section and its one option make Subversion apply the
various rules in the ``[auto-props]`` section automatically to all added or
imported files into the respository.

.. _PEPs: http://www.python.org/dev/peps/



What tools do I need to merge between branches?
-----------------------------------------------

You need `svnmerge.py
<http://svn.apache.org/repos/asf/subversion/trunk/contrib/client-side/svnmerge/svnmerge.py>`__.<commit_msg>svn config info has moved out of the dev FAQ.<commit_after>Content-type: text/x-rst
Title: Frequently Asked Questions for Python Developers

:Title: Frequently Asked Questions for Python Developers
:Date: $Date: 2010-09-15 07:35:08 -0700 (Wed, 15 Sep 2010) $
:Version: $Revision: 10931 $
:Web site: http://www.python.org/dev/faq/

.. contents:: :depth: 3
.. sectnum::

General Information
=====================================================================


How can I become a developer?
---------------------------------------------------------------------------

Contribute on a regular basis through patches and ask for commit
privileges once you have demonstrated a track record of being good
at fixing things.

(<NAME> commented on the
`School of Hard Knocks <http://mail.python.org/pipermail/python-dev/2002-September/028725.html>`_ required.)



Version Control
==================================


What do I need to use Subversion?
-------------------------------------------------------------------------------

.. _download Subversion: http://subversion.apache.org/packages.html

UNIX
'''''''''''''''''''

If you have checkin rights, you need OpenSSH_.  This is needed to verify
your identity when performing commits.

.. _OpenSSH: http://www.openssh.org/

Windows
'''''''''''''''''''

If you have checkin rights, you will also need an SSH client.
`Download PuTTY and friends`_ (PuTTYgen, Pageant, and Plink) for this.  All
other questions in this FAQ will assume you are using these tools.

Once you have both Subversion and PuTTY installed you must tell Subversion
where to find an SSH client.  Do this by editing
``%APPDATA%\Subversion\config`` to have the following
section::

  [tunnels]
  ssh="c:/path/to/putty/plink.exe" -T

Change the path to be the proper one for your system.  The ``-T``
option prevents a pseudo-terminal from being created.

You can use Pageant to prevent from having to type in your password for your
SSH 2 key constantly.  If you prefer not to have another program running,
you need to create a profile in PuTTY.

Go to Session:Saved Sessions and create a new profile named
``svn.python.org``.  In Session:Host Name, enter ``svn.python.org``.  In
SSH/Auth:Private key file select your private key.  In Connection:Auto-login
username enter ``pythondev``.

With this set up, paths are slightly different than most other settings in that
the username is not required.  Do take notice of this when choosing to check
out a project!

.. _download TortoiseSVN: http://tortoisesvn.net/downloads
.. _PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/
.. _download PuTTY and friends: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


How do I get a checkout of the repository (read-only or read-write)?
-------------------------------------------------------------------------------

For a read-write checkout (with a caveat for Windows users using PuTTY without
Pageant), the format for ``<URL>`` is::

 svn+ssh://pythondev@svn.python.org/<path>

There are three critical differences between a read-only URL and a read-write
URL.  One is the protocol being specified as ``svn+ssh`` and not ``http``.
Next, the username ``pythondev`` is added (*note* that
Windows users using PuTTY without Pageant should leave off ``pythondev@`` if
PuTTY was set up following the instructions in this FAQ).  Lastly, note that
``projects`` was removed from the path entirely for a read-write checkout.

The repositories most people will be interested in are:

=========== ============================================================== ==========================================================================
Repository  read-only                                                      read-write
----------- -------------------------------------------------------------- --------------------------------------------------------------------------
PEPs        http://svn.python.org/projects/peps/trunk                      svn+ssh://pythondev@svn.python.org/peps/trunk
2.7         http://svn.python.org/projects/python/branches/release27-maint svn+ssh://pythondev@svn.python.org/python/branches/release27-maint
3.1         http://svn.python.org/projects/python/branches/release31-maint svn+ssh://pythondev@svn.python.org/python/branches/release31-maint
3.2         http://svn.python.org/projects/python/branches/py3k            svn+ssh://pythondev@svn.python.org/python/branches/py3k
=========== ============================================================== ==========================================================================



How do I browse the source code through a web browser?
-------------------------------------------------------------------------------

Visit http://svn.python.org/view/ to browse the Subversion repository.


Where can I find a downloadable snapshot of the source code?
-------------------------------------------------------------------------------

Visit http://svn.python.org/snapshots/ to download a tarball containing a daily
snapshot of the repository.


Who has commit privileges on the Subversion repository?
-------------------------------------------------------------------------------

See http://www.python.org/dev/committers for a list of committers.


How do I verify that my commit privileges are working?
-------------------------------------------------------------------------------

UNIX
'''''''''''''''''''

If you are listed as a committer at http://www.python.org/dev/committers , then
you should be able to execute::

  ssh <EMAIL>

and have the following printed to your terminal::

  ( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries
    commit-revprops depth log-revprops partial-replay ) ) )

If something else is printed, then there is a problem with your SSH 2 public
key and you should contact <EMAIL> .

Windows
'''''''''''''''''''

If you are using Pageant, you can verify that your SSH 2 key is set up properly
by running::

  c:\path\to\putty\plink.exe <EMAIL>

Using the proper path to your PuTTY installation, you should get a response
from the server that says::

  ( success ( 1 2 ( ANONYMOUS EXTERNAL ) ( edit-pipeline ) ) )

If there is a failure, run ``plink`` with ``-v`` to analyse the problem.

If you are using a profile in PuTTY, the best way to test is to try to log in
through Open.



What tools do I need to merge between branches?
-----------------------------------------------

You need `svnmerge.py
<http://svn.apache.org/repos/asf/subversion/trunk/contrib/client-side/svnmerge/svnmerge.py>`__.
{'fraction_non_alphanumeric': 0.2503169460487393, 'fraction_numerical': 0.009015354275250036, 'mean_word_length': 2.492988929889299, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 13, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7157474', 'n_tokens_mistral': 3878, 'n_tokens_neox': 3579, 'n_words': 1438}