Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f8ced2

Browse files
committed
Merged revisions 62998-63003,63005-63006,63009-63012,63014-63017,63019-63020,63022-63024,63026-63029,63031-63041,63043-63045,63047-63054,63056-63062 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r62998 | andrew.kuchling | 2008-05-10 15:51:55 -0400 (Sat, 10 May 2008) | 7 lines #1858 from Tarek Ziade: Allow multiple repositories in .pypirc; see http://wiki.python.org/moin/EnhancedPyPI for discussion. The patch is slightly revised from Tarek's last patch: I've simplified the PyPIRCCommand.finalize_options() method to not look at sys.argv. Tests still pass. ........ r63000 | alexandre.vassalotti | 2008-05-10 15:59:16 -0400 (Sat, 10 May 2008) | 5 lines Cleaned up io._BytesIO.write(). I am amazed that the old code, for inserting null-bytes, actually worked. Who wrote that thing? Oh, it is me... doh. ........ r63002 | brett.cannon | 2008-05-10 16:52:01 -0400 (Sat, 10 May 2008) | 2 lines Revert r62998 as it broke the build (seems distutils.config is missing). ........ r63014 | andrew.kuchling | 2008-05-10 18:12:38 -0400 (Sat, 10 May 2008) | 1 line #1858: add distutils.config module ........ r63027 | brett.cannon | 2008-05-10 21:09:32 -0400 (Sat, 10 May 2008) | 2 lines Flesh out the 3.0 deprecation to suggest using the ctypes module. ........ r63028 | skip.montanaro | 2008-05-10 22:59:30 -0400 (Sat, 10 May 2008) | 4 lines Copied two versions of the example from the interactive session. Delete one. ........ r63037 | georg.brandl | 2008-05-11 03:02:17 -0400 (Sun, 11 May 2008) | 2 lines reload() takes the module itself. ........ r63038 | alexandre.vassalotti | 2008-05-11 03:06:04 -0400 (Sun, 11 May 2008) | 4 lines Added test framework for handling module renames. Factored the import guard in test_py3kwarn.TestStdlibRemovals into a context manager, namely test_support.CleanImport. ........ r63039 | georg.brandl | 2008-05-11 03:06:05 -0400 (Sun, 11 May 2008) | 2 lines #2742: ``''`` is not converted to NULL in getaddrinfo. ........ r63040 | alexandre.vassalotti | 2008-05-11 03:08:12 -0400 (Sun, 11 May 2008) | 2 lines Fixed typo in a comment of test_support.CleanImport. ........ r63041 | alexandre.vassalotti | 2008-05-11 03:10:25 -0400 (Sun, 11 May 2008) | 2 lines Removed a dead line of code. ........ r63043 | georg.brandl | 2008-05-11 04:47:53 -0400 (Sun, 11 May 2008) | 2 lines #2812: document property.getter/setter/deleter. ........ r63049 | georg.brandl | 2008-05-11 05:06:30 -0400 (Sun, 11 May 2008) | 2 lines #1153769: document PEP 237 changes to string formatting. ........ r63050 | georg.brandl | 2008-05-11 05:11:40 -0400 (Sun, 11 May 2008) | 2 lines #2809: elaborate str.split docstring a bit. ........ r63051 | georg.brandl | 2008-05-11 06:13:59 -0400 (Sun, 11 May 2008) | 2 lines Fix typo. ........ r63052 | georg.brandl | 2008-05-11 06:33:27 -0400 (Sun, 11 May 2008) | 2 lines #2709: clarification. ........ r63053 | georg.brandl | 2008-05-11 06:42:28 -0400 (Sun, 11 May 2008) | 2 lines #2659: add ``break_on_hyphens`` to TextWrapper. ........ r63057 | georg.brandl | 2008-05-11 06:59:39 -0400 (Sun, 11 May 2008) | 2 lines #2741: clarification of value range for address_family. ........ r63058 | georg.brandl | 2008-05-11 07:09:35 -0400 (Sun, 11 May 2008) | 2 lines #2452: timeout is used for all blocking operations. ........ r63059 | andrew.kuchling | 2008-05-11 09:33:56 -0400 (Sun, 11 May 2008) | 2 lines #1792: Improve performance of marshal.dumps() on large objects by increasing the size of the buffer more quickly. ........ r63060 | andrew.kuchling | 2008-05-11 10:00:00 -0400 (Sun, 11 May 2008) | 1 line #1858: re-apply patch for this, adding the missing files ........ r63061 | benjamin.peterson | 2008-05-11 10:13:25 -0400 (Sun, 11 May 2008) | 2 lines Add the "until" command to pdb ........ r63062 | georg.brandl | 2008-05-11 10:17:13 -0400 (Sun, 11 May 2008) | 2 lines Add some sentence endings. ........
1 parent a79e33e commit 5f8ced2

38 files changed

Lines changed: 557 additions & 190 deletions

Doc/distutils/packageindex.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,40 @@ The .pypirc file
5555

5656
The format of the :file:`.pypirc` file is as follows::
5757

58-
[server-login]
58+
[distutils]
59+
index-servers =
60+
pypi
61+
62+
[pypi]
5963
repository: <repository-url>
6064
username: <username>
6165
password: <password>
6266

6367
*repository* can be omitted and defaults to ``http://www.python.org/pypi``.
6468

69+
If you want to define another server a new section can be created::
70+
71+
[distutils]
72+
index-servers =
73+
pypi
74+
other
75+
76+
[pypi]
77+
repository: <repository-url>
78+
username: <username>
79+
password: <password>
80+
81+
[other]
82+
repository: http://example.com/pypi
83+
username: <username>
84+
password: <password>
85+
86+
The command can then be called with the -r option::
87+
88+
python setup.py register -r http://example.com/pypi
89+
90+
Or even with the section name::
91+
92+
python setup.py register -r other
6593

94+

Doc/distutils/uploading.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ The :command:`upload` command uses the username, password, and repository URL
2222
from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this
2323
file).
2424

25+
You can specify another PyPI server with the :option:`--repository=*url*` option::
26+
27+
python setup.py sdist bdist_wininst upload -r http://example.com/pypi
28+
29+
See section :ref:`pypirc` for more on defining several servers.
30+
2531
You can use the :option:`--sign` option to tell :command:`upload` to sign each
2632
uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must
2733
be available for execution on the system :envvar:`PATH`. You can also specify
2834
which key to use for signing using the :option:`--identity=*name*` option.
2935

30-
Other :command:`upload` options include :option:`--repository=*url*` (which
31-
lets you override the repository setting from :file:`$HOME/.pypirc`), and
36+
Other :command:`upload` options include :option:`--repository=*url*`
37+
or :option:`--repository=*section*` where `url` is the url of the server
38+
and `section` the name of the section in :file:`$HOME/.pypirc`, and
3239
:option:`--show-response` (which displays the full response text from the PyPI
3340
server for help in debugging upload problems).
3441

35-

Doc/library/bdb.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ The :mod:`bdb` module also defines two classes:
207207

208208
Stop when returning from the given frame.
209209

210+
.. method:: set_until(frame)
211+
212+
Stop when the line with the line no greater than the current one is
213+
reached or when returning from current frame
214+
210215
.. method:: set_trace([frame])
211216

212217
Start debugging from *frame*. If *frame* is not specified, debugging

Doc/library/ftplib.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ The module defines the following items:
4040
.. class:: FTP([host[, user[, passwd[, acct[, timeout]]]]])
4141

4242
Return a new instance of the :class:`FTP` class. When *host* is given, the
43-
method call ``connect(host)`` is made. When *user* is given, additionally the
44-
method call ``login(user, passwd, acct)`` is made (where *passwd* and *acct*
45-
default to the empty string when not given). The optional *timeout* parameter
46-
specifies a timeout in seconds for the connection attempt (if is not specified,
47-
or passed as None, the global default timeout setting will be used).
43+
method call ``connect(host)`` is made. When *user* is given, additionally
44+
the method call ``login(user, passwd, acct)`` is made (where *passwd* and
45+
*acct* default to the empty string when not given). The optional *timeout*
46+
parameter specifies a timeout in seconds for blocking operations like the
47+
connection attempt (if is not specified, or passed as None, the global
48+
default timeout setting will be used).
4849

4950

5051
.. attribute:: all_errors
@@ -122,9 +123,10 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
122123
made.
123124

124125
The optional *timeout* parameter specifies a timeout in seconds for the
125-
connection attempt. If is not specified, or passed as None, the object timeout
126-
is used (the timeout that you passed when instantiating the class); if the
127-
object timeout is also None, the global default timeout setting will be used.
126+
connection attempt. If is not specified, or passed as None, the object
127+
timeout is used (the timeout that you passed when instantiating the class);
128+
if the object timeout is also None, the global default timeout setting will
129+
be used.
128130

129131

130132
.. method:: FTP.getwelcome()

Doc/library/functions.rst

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,15 @@ are always available. They are listed here in alphabetical order.
848848
use is to define a managed attribute x::
849849

850850
class C(object):
851-
def __init__(self): self._x = None
852-
def getx(self): return self._x
853-
def setx(self, value): self._x = value
854-
def delx(self): del self._x
851+
def __init__(self):
852+
self._x = None
853+
854+
def getx(self):
855+
return self._x
856+
def setx(self, value):
857+
self._x = value
858+
def delx(self):
859+
del self._x
855860
x = property(getx, setx, delx, "I'm the 'x' property.")
856861

857862
If given, *doc* will be the docstring of the property attribute. Otherwise, the
@@ -867,8 +872,36 @@ are always available. They are listed here in alphabetical order.
867872
"""Get the current voltage."""
868873
return self._voltage
869874

870-
turns the :meth:`voltage` method into a "getter" for a read-only attribute with
871-
the same name.
875+
turns the :meth:`voltage` method into a "getter" for a read-only attribute
876+
with the same name.
877+
878+
A property object has :attr:`getter`, :attr:`setter`, and :attr:`deleter`
879+
methods usable as decorators that create a copy of the property with the
880+
corresponding accessor function set to the decorated function. This is
881+
best explained with an example::
882+
883+
class C(object):
884+
def __init__(self): self._x = None
885+
886+
@property
887+
def x(self):
888+
"""I'm the 'x' property."""
889+
return self._x
890+
891+
@x.setter
892+
def x(self, value):
893+
self._x = value
894+
895+
@x.deleter
896+
def x(self):
897+
del self._x
898+
899+
This code is exactly equivalent to the first example. Be sure to give the
900+
additional functions the same name as the original property (``x`` in this
901+
case.)
902+
903+
The returned property also has the attributes ``fget``, ``fset``, and
904+
``fdel`` corresponding to the constructor arguments.
872905

873906

874907
.. XXX does accept objects with __index__ too

Doc/library/httplib.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ The module provides the following classes:
2727
.. class:: HTTPConnection(host[, port[, strict[, timeout]]])
2828

2929
An :class:`HTTPConnection` instance represents one transaction with an HTTP
30-
server. It should be instantiated passing it a host and optional port number.
31-
If no port number is passed, the port is extracted from the host string if it
32-
has the form ``host:port``, else the default HTTP port (80) is used. When True,
33-
the optional parameter *strict* causes ``BadStatusLine`` to be raised if the
34-
status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. If the
35-
optional *timeout* parameter is given, connection attempts will timeout after
36-
that many seconds (if it is not given or ``None``, the global default timeout
37-
setting is used).
30+
server. It should be instantiated passing it a host and optional port
31+
number. If no port number is passed, the port is extracted from the host
32+
string if it has the form ``host:port``, else the default HTTP port (80) is
33+
used. When True, the optional parameter *strict* causes ``BadStatusLine`` to
34+
be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1
35+
status line. If the optional *timeout* parameter is given, blocking
36+
operations (like connection attempts) will timeout after that many seconds
37+
(if it is not given or ``None``, the global default timeout setting is used).
3838

3939
For example, the following calls all create instances that connect to the server
4040
at the same host and port::

Doc/library/pdb.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ n(ext)
261261
inside a called function, while ``next`` executes called functions at (nearly)
262262
full speed, only stopping at the next line in the current function.)
263263

264+
unt(il)
265+
Continue execution until the line with the the line number greater than the
266+
current one is reached or when returning from current frame.
267+
268+
.. versionadded:: 2.6
269+
264270
r(eturn)
265271
Continue execution until the current function returns.
266272

Doc/library/smtplib.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
1919

2020
.. class:: SMTP([host[, port[, local_hostname[, timeout]]]])
2121

22-
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods that
23-
support a full repertoire of SMTP and ESMTP operations. If the optional host and
24-
port parameters are given, the SMTP :meth:`connect` method is called with those
25-
parameters during initialization. An :exc:`SMTPConnectError` is raised if the
26-
specified host doesn't respond correctly. The optional *timeout* parameter
27-
specifies a timeout in seconds for the connection attempt (if not specified, or
28-
passed as None, the global default timeout setting will be used).
22+
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
23+
that support a full repertoire of SMTP and ESMTP operations. If the optional
24+
host and port parameters are given, the SMTP :meth:`connect` method is called
25+
with those parameters during initialization. An :exc:`SMTPConnectError` is
26+
raised if the specified host doesn't respond correctly. The optional
27+
*timeout* parameter specifies a timeout in seconds for blocking operations
28+
like the connection attempt (if not specified, or passed as None, the global
29+
default timeout setting will be used).
2930

3031
For normal use, you should only require the initialization/connect,
3132
:meth:`sendmail`, and :meth:`quit` methods. An example is included below.
@@ -35,13 +36,14 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
3536

3637
A :class:`SMTP_SSL` instance behaves exactly the same as instances of
3738
:class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is
38-
required from the beginning of the connection and using :meth:`starttls` is not
39-
appropriate. If *host* is not specified, the local host is used. If *port* is
40-
omitted, the standard SMTP-over-SSL port (465) is used. *keyfile* and *certfile*
41-
are also optional, and can contain a PEM formatted private key and certificate
42-
chain file for the SSL connection. The optional *timeout* parameter specifies a
43-
timeout in seconds for the connection attempt (if not specified, or passed as
44-
None, the global default timeout setting will be used).
39+
required from the beginning of the connection and using :meth:`starttls` is
40+
not appropriate. If *host* is not specified, the local host is used. If
41+
*port* is omitted, the standard SMTP-over-SSL port (465) is used. *keyfile*
42+
and *certfile* are also optional, and can contain a PEM formatted private key
43+
and certificate chain file for the SSL connection. The optional *timeout*
44+
parameter specifies a timeout in seconds for blocking operations like the
45+
connection attempt (if not specified, or passed as None, the global default
46+
timeout setting will be used).
4547

4648

4749
.. class:: LMTP([host[, port[, local_hostname]]])

Doc/library/socket.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ The module :mod:`socket` exports the following constants and functions:
213213
service name (like ``'http'``), a numeric port number or ``None``.
214214

215215
The rest of the arguments are optional and must be numeric if specified. For
216-
*host* and *port*, by passing either an empty string or ``None``, you can pass
217-
``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of
218-
5-tuples with the following structure:
216+
*host* and *port*, by passing ``None``, you can pass ``NULL`` to the C API.
217+
The :func:`getaddrinfo` function returns a list of 5-tuples with the following
218+
structure:
219219

220220
``(family, socktype, proto, canonname, sockaddr)``
221221

@@ -785,7 +785,7 @@ sends traffic to the first one connected successfully. ::
785785
import socket
786786
import sys
787787

788-
HOST = '' # Symbolic name meaning all available interfaces
788+
HOST = None # Symbolic name meaning all available interfaces
789789
PORT = 50007 # Arbitrary non-privileged port
790790
s = None
791791
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
@@ -847,7 +847,7 @@ sends traffic to the first one connected successfully. ::
847847

848848
849849
The last example shows how to write a very simple network sniffer with raw
850-
sockets on Windows. The example requires administrator priviliges to modify
850+
sockets on Windows. The example requires administrator privileges to modify
851851
the interface::
852852

853853
import socket

Doc/library/socketserver.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Server Objects
155155
.. data:: address_family
156156

157157
The family of protocols to which the server's socket belongs.
158-
:const:`socket.AF_INET` and :const:`socket.AF_UNIX` are two possible values.
158+
Common examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`.
159159

160160

161161
.. data:: RequestHandlerClass
@@ -199,7 +199,7 @@ The server classes support the following class variables:
199199
.. data:: socket_type
200200

201201
The type of socket used by the server; :const:`socket.SOCK_STREAM` and
202-
:const:`socket.SOCK_DGRAM` are two possible values.
202+
:const:`socket.SOCK_DGRAM` are two common values.
203203

204204
.. data:: timeout
205205

0 commit comments

Comments
 (0)