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

Skip to content

Commit 6c8583f

Browse files
committed
Merged revisions 81365,81367 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r81365 | georg.brandl | 2010-05-19 22:57:08 +0200 (Mi, 19 Mai 2010) | 77 lines Merged revisions 80030,80067,80069,80080-80081,80084,80432-80433,80465-80470,81059,81065-81067 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r80030 | georg.brandl | 2010-04-13 08:43:54 +0200 (Di, 13 Apr 2010) | 1 line Get rid of multi-row cells. ........ r80067 | georg.brandl | 2010-04-14 10:53:38 +0200 (Mi, 14 Apr 2010) | 1 line #5341: typo. ........ r80069 | georg.brandl | 2010-04-14 15:50:31 +0200 (Mi, 14 Apr 2010) | 1 line Add an x-ref to where the O_ constants are documented and move the SEEK_ constants after lseek(). ........ r80080 | georg.brandl | 2010-04-14 21:16:38 +0200 (Mi, 14 Apr 2010) | 1 line #8399: add note about Windows and O_BINARY. ........ r80081 | georg.brandl | 2010-04-14 23:34:44 +0200 (Mi, 14 Apr 2010) | 1 line #5250: document __instancecheck__ and __subclasscheck__. I hope the part about the class/metaclass distinction is understandable. ........ r80084 | georg.brandl | 2010-04-14 23:46:45 +0200 (Mi, 14 Apr 2010) | 1 line Fix missing. ........ r80432 | georg.brandl | 2010-04-24 10:56:58 +0200 (Sa, 24 Apr 2010) | 1 line Markup fixes. ........ r80433 | georg.brandl | 2010-04-24 11:08:10 +0200 (Sa, 24 Apr 2010) | 1 line #7507: quote "!" in pipes.quote(); it is a special character for some shells. ........ r80465 | georg.brandl | 2010-04-25 12:29:17 +0200 (So, 25 Apr 2010) | 1 line Remove LaTeXy index entry syntax. ........ r80466 | georg.brandl | 2010-04-25 12:54:42 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Better cross-referencing in socket and winreg docs. ........ r80467 | georg.brandl | 2010-04-25 12:55:16 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Remove reference to winreg being the fabled high-level registry interface. ........ r80468 | georg.brandl | 2010-04-25 12:55:58 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Minor spelling changes to _winreg docs. ........ r80469 | georg.brandl | 2010-04-25 12:56:41 +0200 (So, 25 Apr 2010) | 1 line Fix code example to have valid syntax so that it can be highlighted. ........ r80470 | georg.brandl | 2010-04-25 12:57:15 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Make socket setblocking <-> settimeout examples symmetric. ........ r81059 | georg.brandl | 2010-05-10 23:02:51 +0200 (Mo, 10 Mai 2010) | 1 line #8642: fix wrong function name. ........ r81065 | georg.brandl | 2010-05-10 23:46:50 +0200 (Mo, 10 Mai 2010) | 1 line Fix reference direction. ........ r81066 | georg.brandl | 2010-05-10 23:50:57 +0200 (Mo, 10 Mai 2010) | 1 line Consolidate deprecation messages. ........ r81067 | georg.brandl | 2010-05-10 23:51:33 +0200 (Mo, 10 Mai 2010) | 1 line Fix typo. ........ ................ r81367 | georg.brandl | 2010-05-19 23:03:51 +0200 (Mi, 19 Mai 2010) | 21 lines Recorded merge of revisions 80466-80469 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r80466 | georg.brandl | 2010-04-25 12:54:42 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Better cross-referencing in socket and winreg docs. ........ r80467 | georg.brandl | 2010-04-25 12:55:16 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Remove reference to winreg being the fabled high-level registry interface. ........ r80468 | georg.brandl | 2010-04-25 12:55:58 +0200 (So, 25 Apr 2010) | 1 line Patch from Tim Hatch: Minor spelling changes to _winreg docs. ........ r80469 | georg.brandl | 2010-04-25 12:56:41 +0200 (So, 25 Apr 2010) | 1 line Fix code example to have valid syntax so that it can be highlighted. ........ ................
1 parent db19fb6 commit 6c8583f

11 files changed

Lines changed: 150 additions & 94 deletions

File tree

Doc/library/fcntl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
.. index::
11-
pair: UNIX@Unix; file control
12-
pair: UNIX@Unix; I/O control
11+
pair: UNIX; file control
12+
pair: UNIX; I/O control
1313

1414
This module performs file control and I/O control on file descriptors. It is an
1515
interface to the :cfunc:`fcntl` and :cfunc:`ioctl` Unix routines.

Doc/library/ftplib.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ The module defines the following items:
4646
connection attempt (if is not specified, the global default timeout setting
4747
will be used).
4848

49-
.. attribute:: all_errors
50-
51-
The set of all exceptions (as a tuple) that methods of :class:`FTP`
52-
instances may raise as a result of problems with the FTP connection (as
53-
opposed to programming errors made by the caller). This set includes the
54-
four exceptions listed below as well as :exc:`socket.error` and
55-
:exc:`IOError`.
56-
5749

5850
.. exception:: error_reply
5951

@@ -76,6 +68,15 @@ The module defines the following items:
7668
with a digit in the range 1--5.
7769

7870

71+
.. data:: all_errors
72+
73+
The set of all exceptions (as a tuple) that methods of :class:`FTP`
74+
instances may raise as a result of problems with the FTP connection (as
75+
opposed to programming errors made by the caller). This set includes the
76+
four exceptions listed above as well as :exc:`socket.error` and
77+
:exc:`IOError`.
78+
79+
7980
.. seealso::
8081

8182
Module :mod:`netrc`

Doc/library/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ I/O Base Classes
235235

236236
Flush and close this stream. This method has no effect if the file is
237237
already closed. Once the file is closed, any operation on the file
238-
(e.g. reading or writing) will raise an :exc:`ValueError`.
238+
(e.g. reading or writing) will raise a :exc:`ValueError`.
239239

240240
As a convenience, it is allowed to call this method more than once;
241241
only the first call, however, will have an effect.

Doc/library/json.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Basic Usage
209209
specified. Encodings that are not ASCII based (such as UCS-2) are not
210210
allowed and should be decoded to :class:`str` first.
211211

212-
The other arguments have the same meaning as in :func:`dump`.
212+
The other arguments have the same meaning as in :func:`load`.
213213

214214

215215
Encoders and decoders

Doc/library/os.rst

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,14 @@ by file descriptors.
584584
Availability: Unix, Windows.
585585

586586

587+
.. data:: SEEK_SET
588+
SEEK_CUR
589+
SEEK_END
590+
591+
Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
592+
respectively. Availability: Windows, Unix.
593+
594+
587595
.. function:: open(file, flags[, mode])
588596

589597
Open the file *file* and set various flags according to *flags* and possibly
@@ -593,7 +601,8 @@ by file descriptors.
593601

594602
For a description of the flag and mode values, see the C run-time documentation;
595603
flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) are defined in
596-
this module too (see below).
604+
this module too (see :ref:`open-constants`). In particular, on Windows adding
605+
:const:`O_BINARY` is needed to open files in binary mode.
597606

598607
Availability: Unix, Windows.
599608

@@ -681,6 +690,12 @@ by file descriptors.
681690
:func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its
682691
:meth:`~file.write` method.
683692

693+
694+
.. _open-constants:
695+
696+
``open()`` flag constants
697+
~~~~~~~~~~~~~~~~~~~~~~~~~
698+
684699
The following constants are options for the *flags* parameter to the
685700
:func:`~os.open` function. They can be combined using the bitwise OR operator
686701
``|``. Some of them are not available on all platforms. For descriptions of
@@ -732,14 +747,6 @@ or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Window
732747
the C library.
733748

734749

735-
.. data:: SEEK_SET
736-
SEEK_CUR
737-
SEEK_END
738-
739-
Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
740-
respectively. Availability: Windows, Unix.
741-
742-
743750
.. _os-file-dir:
744751

745752
Files and Directories

Doc/library/socket.rst

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ All errors raise exceptions. The normal exceptions for invalid argument types
9090
and out-of-memory conditions can be raised; errors related to socket or address
9191
semantics raise the error :exc:`socket.error`.
9292

93-
Non-blocking mode is supported through :meth:`setblocking`. A generalization of
94-
this based on timeouts is supported through :meth:`settimeout`.
93+
Non-blocking mode is supported through :meth:`~socket.setblocking`. A
94+
generalization of this based on timeouts is supported through
95+
:meth:`~socket.settimeout`.
9596

9697
The module :mod:`socket` exports the following constants and functions:
9798

@@ -553,7 +554,9 @@ correspond to Unix system calls applicable to sockets.
553554
:platform: Windows
554555

555556
The :meth:`ioctl` method is a limited interface to the WSAIoctl system
556-
interface. Please refer to the MSDN documentation for more information.
557+
interface. Please refer to the `Win32 documentation
558+
<http://msdn.microsoft.com/en-us/library/ms741621%28VS.85%29.aspx>`_ for more
559+
information.
557560

558561
On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl`
559562
functions may be used; they accept a socket object as their first argument.
@@ -656,7 +659,7 @@ correspond to Unix system calls applicable to sockets.
656659
blocking mode. In non-blocking mode, if a :meth:`recv` call doesn't find any
657660
data, or if a :meth:`send` call can't immediately dispose of the data, a
658661
:exc:`error` exception is raised; in blocking mode, the calls block until they
659-
can proceed. ``s.setblocking(0)`` is equivalent to ``s.settimeout(0)``;
662+
can proceed. ``s.setblocking(0)`` is equivalent to ``s.settimeout(0.0)``;
660663
``s.setblocking(1)`` is equivalent to ``s.settimeout(None)``.
661664

662665

@@ -685,21 +688,21 @@ the system returns an error (such as connection timed out). In
685688
non-blocking mode, operations fail (with an error that is unfortunately
686689
system-dependent) if they cannot be completed immediately. In timeout mode,
687690
operations fail if they cannot be completed within the timeout specified for the
688-
socket or if the system returns an error. The :meth:`setblocking` method is simply
689-
a shorthand for certain :meth:`settimeout` calls.
691+
socket or if the system returns an error. The :meth:`~socket.setblocking`
692+
method is simply a shorthand for certain :meth:`~socket.settimeout` calls.
690693

691694
Timeout mode internally sets the socket in non-blocking mode. The blocking and
692695
timeout modes are shared between file descriptors and socket objects that refer
693696
to the same network endpoint. A consequence of this is that file objects
694-
returned by the :meth:`makefile` method must only be used when the socket is in
695-
blocking mode; in timeout or non-blocking mode file operations that cannot be
696-
completed immediately will fail.
697+
returned by the :meth:`~socket.makefile` method must only be used when the
698+
socket is in blocking mode; in timeout or non-blocking mode file operations
699+
that cannot be completed immediately will fail.
697700

698-
Note that the :meth:`connect` operation is subject to the timeout setting, and
699-
in general it is recommended to call :meth:`settimeout` before calling
700-
:meth:`connect` or pass a timeout parameter to :meth:`create_connection`.
701-
The system network stack may return a connection timeout error
702-
of its own regardless of any Python socket timeout setting.
701+
Note that the :meth:`~socket.connect` operation is subject to the timeout
702+
setting, and in general it is recommended to call :meth:`~socket.settimeout`
703+
before calling :meth:`~socket.connect` or pass a timeout parameter to
704+
:meth:`create_connection`. The system network stack may return a connection
705+
timeout error of its own regardless of any Python socket timeout setting.
703706

704707

705708
.. method:: socket.setsockopt(level, optname, value)
@@ -721,8 +724,8 @@ of its own regardless of any Python socket timeout setting.
721724
are disallowed. If *how* is :const:`SHUT_RDWR`, further sends and receives are
722725
disallowed.
723726

724-
Note that there are no methods :meth:`read` or :meth:`write`; use :meth:`recv`
725-
and :meth:`send` without *flags* argument instead.
727+
Note that there are no methods :meth:`read` or :meth:`write`; use
728+
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
726729

727730
Socket objects also have these (read-only) attributes that correspond to the
728731
values given to the :class:`socket` constructor.
@@ -751,11 +754,12 @@ Example
751754
Here are four minimal example programs using the TCP/IP protocol: a server that
752755
echoes all data that it receives back (servicing only one client), and a client
753756
using it. Note that a server must perform the sequence :func:`socket`,
754-
:meth:`bind`, :meth:`listen`, :meth:`accept` (possibly repeating the
755-
:meth:`accept` to service more than one client), while a client only needs the
756-
sequence :func:`socket`, :meth:`connect`. Also note that the server does not
757-
:meth:`send`/:meth:`recv` on the socket it is listening on but on the new
758-
socket returned by :meth:`accept`.
757+
:meth:`~socket.bind`, :meth:`~socket.listen`, :meth:`~socket.accept` (possibly
758+
repeating the :meth:`~socket.accept` to service more than one client), while a
759+
client only needs the sequence :func:`socket`, :meth:`~socket.connect`. Also
760+
note that the server does not :meth:`~socket.send`/:meth:`~socket.recv` on the
761+
socket it is listening on but on the new socket returned by
762+
:meth:`~socket.accept`.
759763

760764
The first two examples support IPv4 only. ::
761765

0 commit comments

Comments
 (0)