Merged revisions 68521,68527,68534-68536,68540,68547,68552,68563,68570,68572,68575,68579-68580,68584 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68521 | hirokazu.yamamoto | 2009-01-11 04:28:13 +0100 (So, 11 Jan 2009) | 1 line Fixed version number in build_ssl.bat. ........ r68527 | martin.v.loewis | 2009-01-11 10:43:55 +0100 (So, 11 Jan 2009) | 2 lines Issue #4895: Use _strdup on Windows CE. ........ r68534 | gregory.p.smith | 2009-01-11 18:53:33 +0100 (So, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 18:57:54 +0100 (So, 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 20:48:15 +0100 (So, 11 Jan 2009) | 1 line add email addresses ........ r68540 | martin.v.loewis | 2009-01-12 08:57:11 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4915: Port sysmodule to Windows CE. ........ r68547 | kristjan.jonsson | 2009-01-12 19:09:27 +0100 (Mo, 12 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ........ r68552 | vinay.sajip | 2009-01-12 21:36:18 +0100 (Mo, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-13 02:49:10 +0100 (Di, 13 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 10:08:32 +0100 (Di, 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. ........ r68572 | andrew.kuchling | 2009-01-13 14:40:54 +0100 (Di, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 18:32:28 +0100 (Di, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68579 | benjamin.peterson | 2009-01-13 22:42:23 +0100 (Di, 13 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib #4936 ........ r68580 | benjamin.peterson | 2009-01-13 22:43:11 +0100 (Di, 13 Jan 2009) | 1 line add bytearrayobject.h to PYTHON_HEADERS ........ r68584 | benjamin.peterson | 2009-01-13 23:22:41 +0100 (Di, 13 Jan 2009) | 1 line de-spacify ........
This commit is contained in:
parent
8b9ccadb15
commit
686d53eed3
|
@ -3,7 +3,7 @@
|
||||||
2to3 - Automated Python 2 to 3 code translation
|
2to3 - Automated Python 2 to 3 code translation
|
||||||
===============================================
|
===============================================
|
||||||
|
|
||||||
.. sectionauthor:: Benjamin Peterson
|
.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
|
||||||
|
|
||||||
2to3 is a Python program that reads Python 2.x source code and applies a series
|
2to3 is a Python program that reads Python 2.x source code and applies a series
|
||||||
of *fixers* to transform it into valid Python 3.x code. The standard library
|
of *fixers* to transform it into valid Python 3.x code. The standard library
|
||||||
|
|
|
@ -113,8 +113,25 @@ The :mod:`binascii` module defines the following functions:
|
||||||
print binascii.crc32("hello world")
|
print binascii.crc32("hello world")
|
||||||
# Or, in two pieces:
|
# Or, in two pieces:
|
||||||
crc = binascii.crc32("hello")
|
crc = binascii.crc32("hello")
|
||||||
crc = binascii.crc32(" world", crc)
|
crc = binascii.crc32(" world", crc) & 0xffffffff
|
||||||
print crc
|
print 'crc32 = 0x%08x' % crc
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
To generate the same numeric value across all Python versions and
|
||||||
|
platforms use crc32(data) & 0xffffffff. If you are only using
|
||||||
|
the checksum in packed binary format this is not necessary as the
|
||||||
|
return value will have the correct 32bit binary representation
|
||||||
|
regardless of sign.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.6
|
||||||
|
The return value will always be in the range [-2**31, 2**31-1]
|
||||||
|
regardless of platform. In the past the value would be signed on
|
||||||
|
some platforms and unsigned on others. Use & 0xffffffff on the
|
||||||
|
value if you want it to match 3.0 behavior.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.0
|
||||||
|
The return value will always be unsigned and in the range [0, 2**32-1]
|
||||||
|
regardless of platform.
|
||||||
|
|
||||||
|
|
||||||
.. function:: b2a_hex(data)
|
.. function:: b2a_hex(data)
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
.. module:: hashlib
|
.. module:: hashlib
|
||||||
:synopsis: Secure hash and message digest algorithms.
|
:synopsis: Secure hash and message digest algorithms.
|
||||||
.. moduleauthor:: Gregory P. Smith <greg@users.sourceforge.net>
|
.. moduleauthor:: Gregory P. Smith <greg@krypto.org>
|
||||||
.. sectionauthor:: Gregory P. Smith <greg@users.sourceforge.net>
|
.. sectionauthor:: Gregory P. Smith <greg@krypto.org>
|
||||||
|
|
||||||
|
|
||||||
.. versionadded:: 2.5
|
.. versionadded:: 2.5
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
.. moduleauthor:: Guido van Rossum <guido@python.org>
|
.. moduleauthor:: Guido van Rossum <guido@python.org>
|
||||||
.. moduleauthor:: Mike Verdone <mike.verdone@gmail.com>
|
.. moduleauthor:: Mike Verdone <mike.verdone@gmail.com>
|
||||||
.. moduleauthor:: Mark Russell <mark.russell@zen.co.uk>
|
.. moduleauthor:: Mark Russell <mark.russell@zen.co.uk>
|
||||||
.. sectionauthor:: Benjamin Peterson
|
.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
|
||||||
.. versionadded:: 2.6
|
.. versionadded:: 2.6
|
||||||
|
|
||||||
The :mod:`io` module provides the Python interfaces to stream handling. The
|
The :mod:`io` module provides the Python interfaces to stream handling. The
|
||||||
|
|
|
@ -526,38 +526,37 @@ provided:
|
||||||
|
|
||||||
#. :class:`FileHandler` instances send error messages to disk files.
|
#. :class:`FileHandler` instances send error messages to disk files.
|
||||||
|
|
||||||
.. currentmodule:: logging.handlers
|
#. :class:`handlers.BaseRotatingHandler` is the base class for handlers that
|
||||||
|
rotate log files at a certain point. It is not meant to be instantiated
|
||||||
|
directly. Instead, use :class:`RotatingFileHandler` or
|
||||||
|
:class:`TimedRotatingFileHandler`.
|
||||||
|
|
||||||
#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log
|
#. :class:`handlers.RotatingFileHandler` instances send error messages to disk files,
|
||||||
files at a certain point. It is not meant to be instantiated directly. Instead,
|
|
||||||
use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`.
|
|
||||||
|
|
||||||
#. :class:`RotatingFileHandler` instances send error messages to disk files,
|
|
||||||
with support for maximum log file sizes and log file rotation.
|
with support for maximum log file sizes and log file rotation.
|
||||||
|
|
||||||
#. :class:`TimedRotatingFileHandler` instances send error messages to disk files
|
#. :class:`handlers.TimedRotatingFileHandler` instances send error messages to disk files
|
||||||
rotating the log file at certain timed intervals.
|
rotating the log file at certain timed intervals.
|
||||||
|
|
||||||
#. :class:`SocketHandler` instances send error messages to TCP/IP sockets.
|
#. :class:`handlers.SocketHandler` instances send error messages to TCP/IP sockets.
|
||||||
|
|
||||||
#. :class:`DatagramHandler` instances send error messages to UDP sockets.
|
#. :class:`handlers.DatagramHandler` instances send error messages to UDP sockets.
|
||||||
|
|
||||||
#. :class:`SMTPHandler` instances send error messages to a designated email
|
#. :class:`handlers.SMTPHandler` instances send error messages to a designated email
|
||||||
address.
|
address.
|
||||||
|
|
||||||
#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon,
|
#. :class:`handlers.SysLogHandler` instances send error messages to a Unix syslog daemon,
|
||||||
possibly on a remote machine.
|
possibly on a remote machine.
|
||||||
|
|
||||||
#. :class:`NTEventLogHandler` instances send error messages to a Windows
|
#. :class:`handlers.NTEventLogHandler` instances send error messages to a Windows
|
||||||
NT/2000/XP event log.
|
NT/2000/XP event log.
|
||||||
|
|
||||||
#. :class:`MemoryHandler` instances send error messages to a buffer in memory,
|
#. :class:`handlers.MemoryHandler` instances send error messages to a buffer in memory,
|
||||||
which is flushed whenever specific criteria are met.
|
which is flushed whenever specific criteria are met.
|
||||||
|
|
||||||
#. :class:`HTTPHandler` instances send error messages to an HTTP server using
|
#. :class:`handlers.HTTPHandler` instances send error messages to an HTTP server using
|
||||||
either ``GET`` or ``POST`` semantics.
|
either ``GET`` or ``POST`` semantics.
|
||||||
|
|
||||||
#. :class:`WatchedFileHandler` instances watch the file they are logging to. If
|
#. :class:`handlers.WatchedFileHandler` instances watch the file they are logging to. If
|
||||||
the file changes, it is closed and reopened using the file name. This handler
|
the file changes, it is closed and reopened using the file name. This handler
|
||||||
is only useful on Unix-like systems; Windows does not support the underlying
|
is only useful on Unix-like systems; Windows does not support the underlying
|
||||||
mechanism used.
|
mechanism used.
|
||||||
|
|
|
@ -325,8 +325,7 @@ Turtle motion
|
||||||
|
|
||||||
:param y: a number (integer or float)
|
:param y: a number (integer or float)
|
||||||
|
|
||||||
Set the turtle's first coordinate to *y*, leave second coordinate
|
Set the turtle's second coordinate to *y*, leave first coordinate unchanged.
|
||||||
unchanged.
|
|
||||||
|
|
||||||
>>> turtle.position()
|
>>> turtle.position()
|
||||||
(0.00, 40.00)
|
(0.00, 40.00)
|
||||||
|
|
|
@ -31,22 +31,34 @@ The available exception and functions in this module are:
|
||||||
Exception raised on compression and decompression errors.
|
Exception raised on compression and decompression errors.
|
||||||
|
|
||||||
|
|
||||||
.. function:: adler32(string[, value])
|
.. function:: adler32(data[, value])
|
||||||
|
|
||||||
Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as
|
Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
|
||||||
reliable as a CRC32 but can be computed much more quickly.) If *value* is
|
reliable as a CRC32 but can be computed much more quickly.) If *value* is
|
||||||
present, it is used as the starting value of the checksum; otherwise, a fixed
|
present, it is used as the starting value of the checksum; otherwise, a fixed
|
||||||
default value is used. This allows computing a running checksum over the
|
default value is used. This allows computing a running checksum over the
|
||||||
concatenation of several input strings. The algorithm is not cryptographically
|
concatenation of several inputs. The algorithm is not cryptographically
|
||||||
strong, and should not be used for authentication or digital signatures. Since
|
strong, and should not be used for authentication or digital signatures. Since
|
||||||
the algorithm is designed for use as a checksum algorithm, it is not suitable
|
the algorithm is designed for use as a checksum algorithm, it is not suitable
|
||||||
for use as a general hash algorithm.
|
for use as a general hash algorithm.
|
||||||
|
|
||||||
This function always returns an integer object.
|
This function always returns an integer object.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
To generate the same numeric value across all Python versions and
|
||||||
|
platforms use adler32(data) & 0xffffffff. If you are only using
|
||||||
|
the checksum in packed binary format this is not necessary as the
|
||||||
|
return value will have the correct 32bit binary representation
|
||||||
|
regardless of sign.
|
||||||
|
|
||||||
.. versionchanged:: 2.6
|
.. versionchanged:: 2.6
|
||||||
For consistent cross-platform behavior we always return a signed integer.
|
The return value will always be in the range [-2**31, 2**31-1]
|
||||||
ie: Results in the (2**31)...(2**32-1) range will be negative.
|
regardless of platform. In older versions the value would be
|
||||||
|
signed on some platforms and unsigned on others.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.0
|
||||||
|
The return value will always be unsigned and in the range [0, 2**32-1]
|
||||||
|
regardless of platform.
|
||||||
|
|
||||||
|
|
||||||
.. function:: compress(string[, level])
|
.. function:: compress(string[, level])
|
||||||
|
@ -66,25 +78,37 @@ The available exception and functions in this module are:
|
||||||
``9`` is slowest and produces the most. The default value is ``6``.
|
``9`` is slowest and produces the most. The default value is ``6``.
|
||||||
|
|
||||||
|
|
||||||
.. function:: crc32(string[, value])
|
.. function:: crc32(data[, value])
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
single: Cyclic Redundancy Check
|
single: Cyclic Redundancy Check
|
||||||
single: checksum; Cyclic Redundancy Check
|
single: checksum; Cyclic Redundancy Check
|
||||||
|
|
||||||
Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is
|
Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is
|
||||||
present, it is used as the starting value of the checksum; otherwise, a fixed
|
present, it is used as the starting value of the checksum; otherwise, a fixed
|
||||||
default value is used. This allows computing a running checksum over the
|
default value is used. This allows computing a running checksum over the
|
||||||
concatenation of several input strings. The algorithm is not cryptographically
|
concatenation of several inputs. The algorithm is not cryptographically
|
||||||
strong, and should not be used for authentication or digital signatures. Since
|
strong, and should not be used for authentication or digital signatures. Since
|
||||||
the algorithm is designed for use as a checksum algorithm, it is not suitable
|
the algorithm is designed for use as a checksum algorithm, it is not suitable
|
||||||
for use as a general hash algorithm.
|
for use as a general hash algorithm.
|
||||||
|
|
||||||
This function always returns an integer object.
|
This function always returns an integer object.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
To generate the same numeric value across all Python versions and
|
||||||
|
platforms use crc32(data) & 0xffffffff. If you are only using
|
||||||
|
the checksum in packed binary format this is not necessary as the
|
||||||
|
return value will have the correct 32bit binary representation
|
||||||
|
regardless of sign.
|
||||||
|
|
||||||
.. versionchanged:: 2.6
|
.. versionchanged:: 2.6
|
||||||
For consistent cross-platform behavior we always return a signed integer.
|
The return value will always be in the range [-2**31, 2**31-1]
|
||||||
ie: Results in the (2**31)...(2**32-1) range will be negative.
|
regardless of platform. In older versions the value would be
|
||||||
|
signed on some platforms and unsigned on others.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.0
|
||||||
|
The return value will always be unsigned and in the range [0, 2**32-1]
|
||||||
|
regardless of platform.
|
||||||
|
|
||||||
|
|
||||||
.. function:: decompress(string[, wbits[, bufsize]])
|
.. function:: decompress(string[, wbits[, bufsize]])
|
||||||
|
|
|
@ -249,12 +249,12 @@ class MutableSet(Set):
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add(self, value):
|
def add(self, value):
|
||||||
"""Return True if it was added, False if already there."""
|
"""Add an element."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def discard(self, value):
|
def discard(self, value):
|
||||||
"""Return True if it was deleted, False if not there."""
|
"""Remove an element. Do not raise an exception if absent."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def remove(self, value):
|
def remove(self, value):
|
||||||
|
|
|
@ -856,6 +856,14 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
|
||||||
# A naive object replaces %z and %Z w/ empty strings.
|
# A naive object replaces %z and %Z w/ empty strings.
|
||||||
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
||||||
|
|
||||||
|
#make sure that invalid format specifiers are handled correctly
|
||||||
|
self.assertRaises(ValueError, t.strftime, "%e")
|
||||||
|
self.assertRaises(ValueError, t.strftime, "%")
|
||||||
|
self.assertRaises(ValueError, t.strftime, "%#")
|
||||||
|
|
||||||
|
#check that this standard extension works
|
||||||
|
t.strftime("%f")
|
||||||
|
|
||||||
|
|
||||||
def test_format(self):
|
def test_format(self):
|
||||||
dt = self.theclass(2007, 9, 10)
|
dt = self.theclass(2007, 9, 10)
|
||||||
|
|
|
@ -533,6 +533,55 @@ class Win32ErrorTests(unittest.TestCase):
|
||||||
def test_chmod(self):
|
def test_chmod(self):
|
||||||
self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
|
self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
|
||||||
|
|
||||||
|
class TestInvalidFD(unittest.TestCase):
|
||||||
|
singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat",
|
||||||
|
"fstatvfs", "fsync", "tcgetpgrp", "ttyname"]
|
||||||
|
def get_single(f):
|
||||||
|
def helper(self):
|
||||||
|
if getattr(os, f, None):
|
||||||
|
self.assertRaises(OSError, getattr(os, f), 10)
|
||||||
|
return helper
|
||||||
|
for f in singles:
|
||||||
|
locals()["test_"+f] = get_single(f)
|
||||||
|
|
||||||
|
def test_isatty(self):
|
||||||
|
self.assertEqual(os.isatty(10), False)
|
||||||
|
|
||||||
|
def test_closerange(self):
|
||||||
|
self.assertEqual(os.closerange(10, 20), None)
|
||||||
|
|
||||||
|
def test_dup2(self):
|
||||||
|
self.assertRaises(OSError, os.dup2, 10, 20)
|
||||||
|
|
||||||
|
def test_fchmod(self):
|
||||||
|
if hasattr(os, "fchmod"):
|
||||||
|
self.assertRaises(OSError, os.fchmod, 10, 0)
|
||||||
|
|
||||||
|
def test_fchown(self):
|
||||||
|
if hasattr(os, "fchown"):
|
||||||
|
self.assertRaises(OSError, os.fchmod, 10, -1, -1)
|
||||||
|
|
||||||
|
def test_fpathconf(self):
|
||||||
|
if hasattr(os, "fpathconf"):
|
||||||
|
self.assertRaises(OSError, os.fpathconf, 10, "foo")
|
||||||
|
|
||||||
|
def test_ftruncate(self):
|
||||||
|
if hasattr(os, "ftruncate"):
|
||||||
|
self.assertRaises(OSError, os.ftruncate, 10, 0)
|
||||||
|
|
||||||
|
def test_lseek(self):
|
||||||
|
self.assertRaises(OSError, os.lseek, 10, 0, 0)
|
||||||
|
|
||||||
|
def test_read(self):
|
||||||
|
self.assertRaises(OSError, os.read, 10, 1)
|
||||||
|
|
||||||
|
def test_tcsetpgrpt(self):
|
||||||
|
if hasattr(os, "tcsetpgrp"):
|
||||||
|
self.assertRaises(OSError, os.tcsetpgrp, 10, 0)
|
||||||
|
|
||||||
|
def test_write(self):
|
||||||
|
self.assertRaises(OSError, os.write, 10, " ")
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
class Win32ErrorTests(unittest.TestCase):
|
class Win32ErrorTests(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
|
@ -547,7 +596,8 @@ def test_main():
|
||||||
MakedirTests,
|
MakedirTests,
|
||||||
DevNullTests,
|
DevNullTests,
|
||||||
URandomTests,
|
URandomTests,
|
||||||
Win32ErrorTests
|
Win32ErrorTests,
|
||||||
|
TestInvalidFD
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -565,6 +565,9 @@ STRINGLIB_HEADERS= \
|
||||||
Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
|
Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
|
||||||
$(STRINGLIB_HEADERS)
|
$(STRINGLIB_HEADERS)
|
||||||
|
|
||||||
|
Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \
|
||||||
|
$(STRINGLIB_HEADERS)
|
||||||
|
|
||||||
Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
|
Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
|
||||||
$(STRINGLIB_HEADERS)
|
$(STRINGLIB_HEADERS)
|
||||||
|
|
||||||
|
@ -585,6 +588,7 @@ PYTHON_HEADERS= \
|
||||||
Include/ast.h \
|
Include/ast.h \
|
||||||
Include/bitset.h \
|
Include/bitset.h \
|
||||||
Include/boolobject.h \
|
Include/boolobject.h \
|
||||||
|
Include/bytearrayobject.h \
|
||||||
Include/bytes_methods.h \
|
Include/bytes_methods.h \
|
||||||
Include/bytesobject.h \
|
Include/bytesobject.h \
|
||||||
Include/bufferobject.h \
|
Include/bufferobject.h \
|
||||||
|
|
|
@ -16,6 +16,8 @@ Core and Builtins
|
||||||
to str, bytes and bytearray could be optimized away by the compiler, letting
|
to str, bytes and bytearray could be optimized away by the compiler, letting
|
||||||
the interpreter segfault instead of raising an error.
|
the interpreter segfault instead of raising an error.
|
||||||
|
|
||||||
|
- Issue #4915: Port sysmodule to Windows CE.
|
||||||
|
|
||||||
- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
|
- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
|
||||||
an existing .py counterpart, override the co_filename attributes of all
|
an existing .py counterpart, override the co_filename attributes of all
|
||||||
code objects if the original filename is obsolete (which can happen if the
|
code objects if the original filename is obsolete (which can happen if the
|
||||||
|
@ -276,6 +278,8 @@ Tools/Demos
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #4895: Use _strdup on Windows CE.
|
||||||
|
|
||||||
- Issue #4472: "configure --enable-shared" now works on OSX
|
- Issue #4472: "configure --enable-shared" now works on OSX
|
||||||
|
|
||||||
- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
|
- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
|
||||||
|
|
|
@ -1452,11 +1452,14 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size)
|
||||||
size += 1; /* terminating NUL */
|
size += 1; /* terminating NUL */
|
||||||
size *= sizeof(wchar_t);
|
size *= sizeof(wchar_t);
|
||||||
buffer = (wchar_t *)PyMem_Malloc(size);
|
buffer = (wchar_t *)PyMem_Malloc(size);
|
||||||
if (!buffer)
|
if (!buffer) {
|
||||||
|
Py_DECREF(value);
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
|
}
|
||||||
memset(buffer, 0, size);
|
memset(buffer, 0, size);
|
||||||
keep = PyCObject_FromVoidPtr(buffer, PyMem_Free);
|
keep = PyCObject_FromVoidPtr(buffer, PyMem_Free);
|
||||||
if (!keep) {
|
if (!keep) {
|
||||||
|
Py_DECREF(value);
|
||||||
PyMem_Free(buffer);
|
PyMem_Free(buffer);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,12 @@ WIN32 is still required for the locale module.
|
||||||
#define USE_SOCKET
|
#define USE_SOCKET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */
|
||||||
|
#if defined(MS_WINCE)
|
||||||
|
# include <stdlib.h>
|
||||||
|
# define strdup _strdup
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MS_WINCE
|
#ifdef MS_WINCE
|
||||||
/* Python uses GetVersion() to distinguish between
|
/* Python uses GetVersion() to distinguish between
|
||||||
* Windows NT and 9x/ME where OS Unicode support is concerned.
|
* Windows NT and 9x/ME where OS Unicode support is concerned.
|
||||||
|
|
|
@ -1296,8 +1296,13 @@ _PySys_Init(void)
|
||||||
PyDict_SetItemString(sysdict, key, v); \
|
PyDict_SetItemString(sysdict, key, v); \
|
||||||
Py_XDECREF(v)
|
Py_XDECREF(v)
|
||||||
|
|
||||||
|
/* Check that stdin is not a directory
|
||||||
|
Using shell redirection, you can redirect stdin to a directory,
|
||||||
|
crashing the Python interpreter. Catch this common mistake here
|
||||||
|
and output a useful error message. Note that under MS Windows,
|
||||||
|
the shell already prevents that. */
|
||||||
|
#if !defined(MS_WINDOWS)
|
||||||
{
|
{
|
||||||
/* XXX: does this work on Win/Win64? (see posix_fstat) */
|
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
if (fstat(fileno(stdin), &sb) == 0 &&
|
if (fstat(fileno(stdin), &sb) == 0 &&
|
||||||
S_ISDIR(sb.st_mode)) {
|
S_ISDIR(sb.st_mode)) {
|
||||||
|
@ -1307,6 +1312,7 @@ _PySys_Init(void)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Closing the standard FILE* if sys.std* goes aways causes problems
|
/* Closing the standard FILE* if sys.std* goes aways causes problems
|
||||||
* for embedded Python usages. Closing them when somebody explicitly
|
* for embedded Python usages. Closing them when somebody explicitly
|
||||||
|
@ -1526,7 +1532,7 @@ PySys_SetArgv(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_REALPATH)
|
#if defined(HAVE_REALPATH)
|
||||||
char fullpath[MAXPATHLEN];
|
char fullpath[MAXPATHLEN];
|
||||||
#elif defined(MS_WINDOWS)
|
#elif defined(MS_WINDOWS) && !defined(MS_WINCE)
|
||||||
char fullpath[MAX_PATH];
|
char fullpath[MAX_PATH];
|
||||||
#endif
|
#endif
|
||||||
PyObject *av = makeargvobject(argc, argv);
|
PyObject *av = makeargvobject(argc, argv);
|
||||||
|
@ -1571,7 +1577,10 @@ PySys_SetArgv(int argc, char **argv)
|
||||||
#if SEP == '\\' /* Special case for MS filename syntax */
|
#if SEP == '\\' /* Special case for MS filename syntax */
|
||||||
if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
|
if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
|
||||||
char *q;
|
char *q;
|
||||||
#ifdef MS_WINDOWS
|
#if defined(MS_WINDOWS) && !defined(MS_WINCE)
|
||||||
|
/* This code here replaces the first element in argv with the full
|
||||||
|
path that it represents. Under CE, there are no relative paths so
|
||||||
|
the argument must be the full path anyway. */
|
||||||
char *ptemp;
|
char *ptemp;
|
||||||
if (GetFullPathName(argv0,
|
if (GetFullPathName(argv0,
|
||||||
sizeof(fullpath),
|
sizeof(fullpath),
|
||||||
|
|
Loading…
Reference in New Issue