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

Skip to content

Commit 058e31e

Browse files
committed
Merged revisions 68450,68480-68481,68493,68495,68501,68512,68514-68515,68534-68536,68552,68563,68570-68572,68575,68582,68596,68623-68624,68628 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r68450 | jeffrey.yasskin | 2009-01-09 10:47:07 -0600 (Fri, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68480 | vinay.sajip | 2009-01-10 07:38:04 -0600 (Sat, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 07:42:04 -0600 (Sat, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 11:18:55 -0600 (Sat, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 11:36:44 -0600 (Sat, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68501 | vinay.sajip | 2009-01-10 13:22:57 -0600 (Sat, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 16:42:10 -0600 (Sat, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-10 17:41:59 -0600 (Sat, 10 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-10 17:49:08 -0600 (Sat, 10 Jan 2009) | 1 line macos 9 isn't supported ........ r68534 | gregory.p.smith | 2009-01-11 11:53:33 -0600 (Sun, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 11:57:54 -0600 (Sun, 11 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ........ r68536 | benjamin.peterson | 2009-01-11 13:48:15 -0600 (Sun, 11 Jan 2009) | 1 line add email addresses ........ r68552 | vinay.sajip | 2009-01-12 14:36:18 -0600 (Mon, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-12 19:49:10 -0600 (Mon, 12 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 03:08:32 -0600 (Tue, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ........ r68571 | armin.ronacher | 2009-01-13 05:52:23 -0600 (Tue, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ........ r68572 | andrew.kuchling | 2009-01-13 07:40:54 -0600 (Tue, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 11:32:28 -0600 (Tue, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68582 | georg.brandl | 2009-01-13 16:14:01 -0600 (Tue, 13 Jan 2009) | 2 lines Use assertRaises. ........ r68596 | amaury.forgeotdarc | 2009-01-13 17:39:22 -0600 (Tue, 13 Jan 2009) | 3 lines #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. ........ r68623 | vinay.sajip | 2009-01-15 16:48:13 -0600 (Thu, 15 Jan 2009) | 1 line Made minor changes/corrections in markup. Added a couple of section headings. ........ r68624 | vinay.sajip | 2009-01-15 17:04:47 -0600 (Thu, 15 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68628 | benjamin.peterson | 2009-01-15 20:55:24 -0600 (Thu, 15 Jan 2009) | 1 line compare with == not is #4946 ........
1 parent 1456778 commit 058e31e

19 files changed

Lines changed: 140 additions & 59 deletions

File tree

Doc/c-api/typeobj.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ type objects) *must* have the :attr:`ob_size` field.
652652
:attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its
653653
base type.
654654

655-
656655
.. cmember:: getiterfunc PyTypeObject.tp_iter
657656

658657
An optional pointer to a function that returns an iterator for the object. Its

Doc/library/2to3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
2to3 - Automated Python 2 to 3 code translation
44
===============================================
55

6-
.. sectionauthor:: Benjamin Peterson
6+
.. sectionauthor:: Benjamin Peterson <[email protected]>
77

88
2to3 is a Python program that reads Python 2.x source code and applies a series
99
of *fixers* to transform it into valid Python 3.x code. The standard library

Doc/library/binascii.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,19 @@ The :mod:`binascii` module defines the following functions:
113113
print(binascii.crc32("hello world"))
114114
# Or, in two pieces:
115115
crc = binascii.crc32("hello")
116-
crc = binascii.crc32(" world", crc)
117-
print(crc)
116+
crc = binascii.crc32(" world", crc) & 0xffffffff
117+
print('crc32 = 0x%08x' % crc)
118+
119+
.. note::
120+
To generate the same numeric value across all Python versions and
121+
platforms use crc32(data) & 0xffffffff. If you are only using
122+
the checksum in packed binary format this is not necessary as the
123+
return value will have the correct 32bit binary representation
124+
regardless of sign.
125+
126+
.. versionchanged:: 3.0
127+
The return value will always be unsigned and in the range [0, 2**32-1]
128+
regardless of platform.
118129

119130

120131
.. function:: b2a_hex(data)

Doc/library/hashlib.rst

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

55
.. module:: hashlib
66
:synopsis: Secure hash and message digest algorithms.
7-
.. moduleauthor:: Gregory P. Smith <greg@users.sourceforge.net>
8-
.. sectionauthor:: Gregory P. Smith <greg@users.sourceforge.net>
7+
.. moduleauthor:: Gregory P. Smith <greg@krypto.org>
8+
.. sectionauthor:: Gregory P. Smith <greg@krypto.org>
99

1010

1111
.. index::

Doc/library/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.. moduleauthor:: Guido van Rossum <[email protected]>
77
.. moduleauthor:: Mike Verdone <[email protected]>
88
.. moduleauthor:: Mark Russell <[email protected]>
9-
.. sectionauthor:: Benjamin Peterson
9+
.. sectionauthor:: Benjamin Peterson <[email protected]>
1010

1111
The :mod:`io` module provides the Python interfaces to stream handling. The
1212
builtin :func:`open` function is defined in this module.

Doc/library/logging.rst

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ decides to actually dispatch an event, the :meth:`emit` method is used to send
522522
the message to its destination. Most user-defined subclasses of :class:`Handler`
523523
will need to override this :meth:`emit`.
524524

525+
Useful Handlers
526+
---------------
527+
525528
In addition to the base :class:`Handler` class, many useful subclasses are
526529
provided:
527530

@@ -530,41 +533,44 @@ provided:
530533

531534
#. :class:`FileHandler` instances send error messages to disk files.
532535

533-
.. currentmodule:: logging.handlers
536+
.. module:: logging.handlers
534537

535-
#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log
536-
files at a certain point. It is not meant to be instantiated directly. Instead,
537-
use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`.
538+
#. :class:`BaseRotatingHandler` is the base class for handlers that
539+
rotate log files at a certain point. It is not meant to be instantiated
540+
directly. Instead, use :class:`RotatingFileHandler` or
541+
:class:`TimedRotatingFileHandler`.
538542

539-
#. :class:`RotatingFileHandler` instances send error messages to disk files,
540-
with support for maximum log file sizes and log file rotation.
543+
#. :class:`RotatingFileHandler` instances send error messages to disk
544+
files, with support for maximum log file sizes and log file rotation.
541545

542-
#. :class:`TimedRotatingFileHandler` instances send error messages to disk files
543-
rotating the log file at certain timed intervals.
546+
#. :class:`TimedRotatingFileHandler` instances send error messages to
547+
disk files, rotating the log file at certain timed intervals.
544548

545-
#. :class:`SocketHandler` instances send error messages to TCP/IP sockets.
549+
#. :class:`SocketHandler` instances send error messages to TCP/IP
550+
sockets.
546551

547-
#. :class:`DatagramHandler` instances send error messages to UDP sockets.
552+
#. :class:`DatagramHandler` instances send error messages to UDP
553+
sockets.
548554

549-
#. :class:`SMTPHandler` instances send error messages to a designated email
550-
address.
555+
#. :class:`SMTPHandler` instances send error messages to a designated
556+
email address.
551557

552-
#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon,
553-
possibly on a remote machine.
558+
#. :class:`SysLogHandler` instances send error messages to a Unix
559+
syslog daemon, possibly on a remote machine.
554560

555-
#. :class:`NTEventLogHandler` instances send error messages to a Windows
556-
NT/2000/XP event log.
561+
#. :class:`NTEventLogHandler` instances send error messages to a
562+
Windows NT/2000/XP event log.
557563

558-
#. :class:`MemoryHandler` instances send error messages to a buffer in memory,
559-
which is flushed whenever specific criteria are met.
564+
#. :class:`MemoryHandler` instances send error messages to a buffer
565+
in memory, which is flushed whenever specific criteria are met.
560566

561-
#. :class:`HTTPHandler` instances send error messages to an HTTP server using
562-
either ``GET`` or ``POST`` semantics.
567+
#. :class:`HTTPHandler` instances send error messages to an HTTP
568+
server using either ``GET`` or ``POST`` semantics.
563569

564-
#. :class:`WatchedFileHandler` instances watch the file they are logging to. If
565-
the file changes, it is closed and reopened using the file name. This handler
566-
is only useful on Unix-like systems; Windows does not support the underlying
567-
mechanism used.
570+
#. :class:`WatchedFileHandler` instances watch the file they are
571+
logging to. If the file changes, it is closed and reopened using the file
572+
name. This handler is only useful on Unix-like systems; Windows does not
573+
support the underlying mechanism used.
568574

569575
.. currentmodule:: logging
570576

@@ -603,6 +609,9 @@ The basic :class:`Filter` functionality allows filtering by specific logger
603609
name. If this feature is used, messages sent to the named logger and its
604610
children are allowed through the filter, and all others dropped.
605611

612+
Module-Level Functions
613+
----------------------
614+
606615
In addition to the classes described above, there are a number of module- level
607616
functions.
608617

@@ -1626,7 +1635,7 @@ See :ref:`library-config` for more information on how to use
16261635
WatchedFileHandler
16271636
^^^^^^^^^^^^^^^^^^
16281637

1629-
.. module:: logging.handlers
1638+
.. currentmodule:: logging.handlers
16301639

16311640
The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
16321641
module, is a :class:`FileHandler` which watches the file it is logging to. If

Doc/library/sys.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,11 @@ always available.
484484
A program is free to modify this list for its own purposes.
485485

486486

487+
.. seealso::
488+
Module :mod:`site` This describes how to use .pth files to extend
489+
:data:`sys.path`.
490+
491+
487492
.. data:: platform
488493

489494
This string contains a platform identifier that can be used to append
@@ -500,7 +505,6 @@ always available.
500505
Windows ``'win32'``
501506
Windows/Cygwin ``'cygwin'``
502507
Mac OS X ``'darwin'``
503-
Mac OS 9 ``'mac'``
504508
OS/2 ``'os2'``
505509
OS/2 EMX ``'os2emx'``
506510
AtheOS ``'atheos'``
@@ -782,11 +786,3 @@ always available.
782786
first three characters of :const:`version`. It is provided in the :mod:`sys`
783787
module for informational purposes; modifying this value has no effect on the
784788
registry keys used by Python. Availability: Windows.
785-
786-
787-
.. seealso::
788-
789-
Module :mod:`site`
790-
This describes how to use .pth files to extend ``sys.path``.
791-
792-

Doc/library/turtle.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ Turtle motion
322322

323323
:param y: a number (integer or float)
324324

325-
Set the turtle's first coordinate to *y*, leave second coordinate
326-
unchanged.
325+
Set the turtle's second coordinate to *y*, leave first coordinate unchanged.
327326

328327
>>> turtle.position()
329328
(0.00, 40.00)

Doc/library/zlib.rst

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,30 @@ The available exception and functions in this module are:
3131
Exception raised on compression and decompression errors.
3232

3333

34-
.. function:: adler32(string[, value])
34+
.. function:: adler32(data[, value])
3535

36-
Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as
36+
Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
3737
reliable as a CRC32 but can be computed much more quickly.) If *value* is
3838
present, it is used as the starting value of the checksum; otherwise, a fixed
3939
default value is used. This allows computing a running checksum over the
40-
concatenation of several input strings. The algorithm is not cryptographically
40+
concatenation of several inputs. The algorithm is not cryptographically
4141
strong, and should not be used for authentication or digital signatures. Since
4242
the algorithm is designed for use as a checksum algorithm, it is not suitable
4343
for use as a general hash algorithm.
4444

4545
Always returns an unsigned 32-bit integer.
4646

47+
.. note::
48+
To generate the same numeric value across all Python versions and
49+
platforms use adler32(data) & 0xffffffff. If you are only using
50+
the checksum in packed binary format this is not necessary as the
51+
return value will have the correct 32bit binary representation
52+
regardless of sign.
53+
54+
.. versionchanged:: 3.0
55+
The return value will always be unsigned and in the range [0, 2**32-1]
56+
regardless of platform.
57+
4758

4859
.. function:: compress(string[, level])
4960

@@ -62,22 +73,33 @@ The available exception and functions in this module are:
6273
``9`` is slowest and produces the most. The default value is ``6``.
6374

6475

65-
.. function:: crc32(string[, value])
76+
.. function:: crc32(data[, value])
6677

6778
.. index::
6879
single: Cyclic Redundancy Check
6980
single: checksum; Cyclic Redundancy Check
7081

71-
Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is
82+
Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is
7283
present, it is used as the starting value of the checksum; otherwise, a fixed
7384
default value is used. This allows computing a running checksum over the
74-
concatenation of several input strings. The algorithm is not cryptographically
85+
concatenation of several inputs. The algorithm is not cryptographically
7586
strong, and should not be used for authentication or digital signatures. Since
7687
the algorithm is designed for use as a checksum algorithm, it is not suitable
7788
for use as a general hash algorithm.
7889

7990
Always returns an unsigned 32-bit integer.
8091

92+
.. note::
93+
To generate the same numeric value across all Python versions and
94+
platforms use crc32(data) & 0xffffffff. If you are only using
95+
the checksum in packed binary format this is not necessary as the
96+
return value will have the correct 32bit binary representation
97+
regardless of sign.
98+
99+
.. versionchanged:: 3.0
100+
The return value will always be unsigned and in the range [0, 2**32-1]
101+
regardless of platform.
102+
81103

82104
.. function:: decompress(string[, wbits[, bufsize]])
83105

Include/pyport.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,15 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
616616
#define Py_FORMAT_PARSETUPLE(func,p1,p2)
617617
#endif
618618

619+
/*
620+
* Specify alignment on compilers that support it.
621+
*/
622+
#if defined(__GNUC__) && __GNUC__ >= 3
623+
#define Py_ALIGNED(x) __attribute__((aligned(x)))
624+
#else
625+
#define Py_ALIGNED(x)
626+
#endif
627+
619628
/* Eliminate end-of-loop code not reached warnings from SunPro C
620629
* when using do{...}while(0) macros
621630
*/

0 commit comments

Comments
 (0)