]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 61538-61540,61556,61559-61560,61563,61565,61571,61575-61576,61580...
authorChristian Heimes <christian@cheimes.de>
Wed, 19 Mar 2008 21:50:51 +0000 (21:50 +0000)
committerChristian Heimes <christian@cheimes.de>
Wed, 19 Mar 2008 21:50:51 +0000 (21:50 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r61538 | steven.bethard | 2008-03-18 20:03:50 +0100 (Di, 18 Mär 2008) | 1 line

  cell_compare needs to return -2 instead of NULL.
........
  r61539 | steven.bethard | 2008-03-18 20:04:32 +0100 (Di, 18 Mär 2008) | 1 line

  _have_soundcard() is a bad check for winsound.Beep, since you can have a soundcard but have the beep driver disabled. This revision basically disables the beep tests by wrapping them in a try/except. The Right Way To Do It is to come up with a _have_enabled_beep_driver() and use that.
........
  r61540 | gregory.p.smith | 2008-03-18 20:05:32 +0100 (Di, 18 Mär 2008) | 8 lines

  Fix chown on 64-bit linux.  It needed to take a long (64-bit on 64bit linux) as
  uid and gid input to accept values >=2**31 as valid while still accepting
  negative numbers to pass -1 to chown for "no change".

  Fixes issue1747858.

  This should be backported to release25-maint.
........
  r61556 | steven.bethard | 2008-03-18 20:59:14 +0100 (Di, 18 Mär 2008) | 1 line

  Fix test_atexit so that it still passes when -3 is supplied. (It was catching the warning messages on stdio from using the reload() function.)
........
  r61559 | neal.norwitz | 2008-03-18 21:30:38 +0100 (Di, 18 Mär 2008) | 1 line

  Import the test properly.  This is especially important for py3k.
........
  r61560 | gregory.p.smith | 2008-03-18 21:40:01 +0100 (Di, 18 Mär 2008) | 2 lines

  news entry for the chown fix
........
  r61563 | brett.cannon | 2008-03-18 22:12:42 +0100 (Di, 18 Mär 2008) | 2 lines

  Ignore BIG5HKSCS-2004.TXT which is downloaded as part of a test.
........
  r61565 | steven.bethard | 2008-03-18 22:30:13 +0100 (Di, 18 Mär 2008) | 1 line

  Have regrtest skip test_py3kwarn when the -3 flag is missing.
........
  r61571 | gregory.p.smith | 2008-03-18 23:27:41 +0100 (Di, 18 Mär 2008) | 4 lines

  Add a test to make sure zlib.crc32 and binascii.crc32 return the same thing.
  Fix a buglet in binascii.crc32, the second optional argument could previously
  have a signedness mismatch with the C variable its going into.
........
  r61575 | raymond.hettinger | 2008-03-19 00:22:29 +0100 (Mi, 19 Mär 2008) | 1 line

  Speed-up isinstance() for one easy case.
........
  r61576 | raymond.hettinger | 2008-03-19 00:33:08 +0100 (Mi, 19 Mär 2008) | 1 line

  Issue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted().
........
  r61580 | andrew.kuchling | 2008-03-19 02:05:35 +0100 (Mi, 19 Mär 2008) | 1 line

  Add Jeff Rush
........
  r61581 | gregory.p.smith | 2008-03-19 02:38:35 +0100 (Mi, 19 Mär 2008) | 3 lines

  Mention that crc32 and adler32 are available in a different module (zlib).
  Some people look for them in hashlib.
........
  r61582 | gregory.p.smith | 2008-03-19 02:46:10 +0100 (Mi, 19 Mär 2008) | 3 lines

  Use zlib's crc32 routine instead of binascii when available.  zlib's is faster
  when compiled properly optimized and about the same speed otherwise.
........
  r61586 | david.wolever | 2008-03-19 03:26:57 +0100 (Mi, 19 Mär 2008) | 1 line

  Added my name to ACKS
........
  r61591 | gregory.p.smith | 2008-03-19 04:14:41 +0100 (Mi, 19 Mär 2008) | 5 lines

  Fix the struct module DeprecationWarnings that zipfile was triggering by
  removing all use of signed struct values.

  test_zipfile and test_zipfile64 pass.  no more warnings.
........
  r61593 | raymond.hettinger | 2008-03-19 04:56:59 +0100 (Mi, 19 Mär 2008) | 1 line

  Fix compiler warning.
........
  r61595 | martin.v.loewis | 2008-03-19 05:39:13 +0100 (Mi, 19 Mär 2008) | 2 lines

  Issue #2400: Allow relative imports to "import *".
........
  r61605 | martin.v.loewis | 2008-03-19 07:00:28 +0100 (Mi, 19 Mär 2008) | 2 lines

  Import relimport using a relative import.
........
  r61606 | trent.nelson | 2008-03-19 07:28:24 +0100 (Mi, 19 Mär 2008) | 1 line

  Issue2290: Support x64 Windows builds that live in pcbuild/amd64.  Without it, sysutils._python_build() returns the wrong directory, which causes the test_get_config_h_filename method in Lib/distutils/tests/test_sysconfig.py to fail.
........
  r61613 | trent.nelson | 2008-03-19 08:45:19 +0100 (Mi, 19 Mär 2008) | 3 lines

  Refine the Visual Studio 2008 build solution in order to improve how we deal with external components, as well as fixing outstanding issues with Windows x64 build support.  Introduce two new .vcproj files, _bsddb44.vcproj and sqlite3.vcproj, which replace the previous pre-link event scripts for _bsddb and _sqlite3 respectively.  The new project files inherit from our property files as if they were any other Python module.  This has numerous benefits.  First, the components get built with exactly the same compiler flags and settings as the rest of Python.  Second, it makes it much easier to debug problems in the external components when they're part of the build system.  Third, they'll benefit from profile guided optimisation in the release builds, just like the rest of Python core.

  I've also introduced a slightly new pattern for managing externals in subversion.  New components get checked in as <name>-<version>.x, where <version> matches the exact vendor version string.  After the initial import of the external component, the .x is tagged as .0 (i.e. tcl-8.4.18.x -> tcl-8.4.18.0).  Some components may not need any tweaking, whereas there are others that might (tcl/tk fall into this bucket).  In that case, the relevant modifications are made to the .x branch, which will be subsequently tagged as .1 (and then n+1 going forward) when they build successfully and all tests pass.  Buildbots will be converted to rely on these explicit tags only, which makes it easy for us to switch them over to a new version as and when required.  (Simple change to external(-amd64).bat: if we've bumped tcl to 8.4.18.1, change the .bat to rmdir 8.4.18.0 if it exists and check out a new .1 copy.)
........
  r61614 | trent.nelson | 2008-03-19 08:56:39 +0100 (Mi, 19 Mär 2008) | 1 line

  Remove extraneous apostrophe and semi-colon from AdditionalIncludeDirectories.
........
  r61615 | georg.brandl | 2008-03-19 08:56:40 +0100 (Mi, 19 Mär 2008) | 2 lines

  Remove footnote from versionchanged as it upsets LaTeX.
........
  r61616 | georg.brandl | 2008-03-19 08:57:57 +0100 (Mi, 19 Mär 2008) | 2 lines

  Another one.
........
  r61618 | trent.nelson | 2008-03-19 09:06:03 +0100 (Mi, 19 Mär 2008) | 1 line

  Fix the tcl-8.4.18.1 path and make sure we cd into the right directory when building tcl/tk.
........
  r61621 | trent.nelson | 2008-03-19 10:23:08 +0100 (Mi, 19 Mär 2008) | 1 line

  Lets have another try at getting the Windows buildbots in a consistent state before rebuilding using the new process.
........
  r61622 | eric.smith | 2008-03-19 13:09:55 +0100 (Mi, 19 Mär 2008) | 2 lines

  Use test.test_support.captured_stdout instead of a custom contextmanager.
  Thanks Nick Coghlan.
........
  r61623 | eric.smith | 2008-03-19 13:15:10 +0100 (Mi, 19 Mär 2008) | 1 line

  Trivial typo.
........
  r61625 | thomas.heller | 2008-03-19 17:10:57 +0100 (Mi, 19 Mär 2008) | 2 lines

  Checkout sqlite-source when it is not there.
........
  r61627 | brett.cannon | 2008-03-19 17:50:13 +0100 (Mi, 19 Mär 2008) | 5 lines

  test_nis would fail if test.test_support.verbose was true but NIS was not set
  up on the machine.

  Closes issue2411. Thanks Michael Bishop.
........
  r61631 | brett.cannon | 2008-03-19 18:37:43 +0100 (Mi, 19 Mär 2008) | 2 lines

  Use sys.py3kwarning instead of trying to trigger a Py3k-related warning.
........
  r61632 | raymond.hettinger | 2008-03-19 18:45:19 +0100 (Mi, 19 Mär 2008) | 1 line

  Issue 2354: Fix-up compare warning.  Patch contributed by Jeff Balogh.
........
  r61633 | raymond.hettinger | 2008-03-19 18:58:59 +0100 (Mi, 19 Mär 2008) | 1 line

  The filter() function does support a None argument in Py3.0.
........
  r61634 | raymond.hettinger | 2008-03-19 19:01:58 +0100 (Mi, 19 Mär 2008) | 1 line

  Remove itertools warnings I had added before the 2-to-3 handled the migration.
........

26 files changed:
Doc/library/hashlib.rst
Lib/distutils/sysconfig.py
Lib/hashlib.py
Lib/test/regrtest.py
Lib/test/test_import.py
Lib/test/test_int_literal.py
Lib/test/test_nis.py
Lib/test/test_posix.py
Lib/test/test_print.py
Lib/test/test_winsound.py
Lib/test/test_zlib.py
Lib/zipfile.py
Misc/ACKS
Misc/developers.txt
Modules/binascii.c
Modules/posixmodule.c
Objects/abstract.c
Objects/cellobject.c
PCbuild/_bsddb.vcproj
PCbuild/_sqlite3.vcproj
PCbuild/_tkinter.vcproj
PCbuild/pcbuild.sln
PCbuild/pyproject.vsprops
Python/ast.c
Tools/buildbot/external-amd64.bat
Tools/buildbot/external.bat

index a725e076dfd2f32dc907639c749b3ea340533749..f1f5237eb43d78b00f655038733c204fbe2893a1 100644 (file)
@@ -19,6 +19,10 @@ algorithm (defined in Internet :rfc:`1321`).  The terms "secure hash" and
 "message digest" are interchangeable.  Older algorithms were called message
 digests.  The modern term is secure hash.
 
+.. note::
+   If you want the adler32 or crc32 hash functions they are available in
+   the :mod:`zlib` module.
+
 .. warning::
 
    Some algorithms have known hash collision weaknesses, see the FAQ at the end.
index 39216a532fc71625cbf8715600cc9b4c27df057d..d2b2c9a347c7eb0ff712453ace80c2f7e6f07ce4 100644 (file)
@@ -23,7 +23,8 @@ PREFIX = os.path.normpath(sys.prefix)
 EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
 
 # Path to the base directory of the project. On Windows the binary may
-# live in project/PCBuild9
+# live in project/PCBuild9.  If we're dealing with an x64 Windows build,
+# it'll live in project/PCbuild/amd64.
 project_base = os.path.dirname(os.path.abspath(sys.executable))
 if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
     project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
@@ -31,6 +32,10 @@ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
 if os.name == "nt" and "\\pc\\v" in project_base[-10:].lower():
     project_base = os.path.abspath(os.path.join(project_base, os.path.pardir,
                                                 os.path.pardir))
+# PC/AMD64
+if os.name == "nt" and "\\pcbuild\\amd64" in project_base[-14:].lower():
+    project_base = os.path.abspath(os.path.join(project_base, os.path.pardir,
+                                                os.path.pardir))
 
 # python_build: (Boolean) if true, we're either building Python or
 # building an extension with an un-installed Python, so we use
index a39cb57bd80cd2670dff6933008f4dd53101a136..efe66ec600d9312fd8914d71fa1e0e75ebd144b9 100644 (file)
@@ -18,6 +18,9 @@ md5(), sha1(), sha224(), sha256(), sha384(), and sha512()
 More algorithms may be available on your platform but the above are
 guaranteed to exist.
 
+NOTE: If you want the adler32 or crc32 hash functions they are available in
+the zlib module.
+
 Choose your hash function wisely.  Some have known collision weaknesses.
 sha384 and sha512 will be slow on 32 bit platforms.
 
index 2212af559169ebf9c132441e02c0cd2b507cc911..100b26f7316d3811448dbdd59ff13a6ce9530105 100755 (executable)
@@ -1157,6 +1157,14 @@ class _ExpectedSkips:
             if sys.platform != 'sunos5':
                 self.expected.add('test_nis')
 
+            # TODO: This is a hack to raise TestSkipped if -3 is not enabled.
+            # Instead of relying on callable to have a warning, we should expose
+            # the -3 flag to Python code somehow
+            with test_support.catch_warning() as w:
+                callable(int)
+                if w.message is None:
+                    self.expected.add('test_py3kwarn')
+
             self.valid = True
 
     def isvalid(self):
index 6eac67e9900e4f3feb594ee38efc1487c1e20bd7..fe1da52c8c7cd735afabf5d8df3411436324ecf6 100644 (file)
@@ -255,8 +255,20 @@ class PathsTests(unittest.TestCase):
         self.assertEqual(mod.testdata, 'test_trailing_slash')
         unload("test_trailing_slash")
 
+class RelativeImport(unittest.TestCase):
+    def tearDown(self):
+        try:
+            del sys.modules["test.relimport"]
+        except:
+            pass
+
+    def test_relimport_star(self):
+        # This will import * from .test_import.
+        from . import relimport
+        self.assertTrue(hasattr(relimport, "RelativeImport"))
+
 def test_main(verbose=None):
-    run_unittest(ImportTest, PathsTests)
+    run_unittest(ImportTest, PathsTests, RelativeImport)
 
 if __name__ == '__main__':
     test_main()
index c9ad2a3b2ffa8c0dee6c87a3e8c2092466fa30ca..9bd0c412ce9481425519ca19c3641a5856baab92 100644 (file)
@@ -6,7 +6,7 @@ This is complex because of changes due to PEP 237.
 import unittest
 from test import test_support
 
-class TextHexOctBin(unittest.TestCase):
+class TestHexOctBin(unittest.TestCase):
 
     def test_hex_baseline(self):
         # A few upper/lowercase tests
@@ -141,7 +141,7 @@ class TextHexOctBin(unittest.TestCase):
         self.assertEqual(-0b1111111111111111111111111111111111111111111111111111111111111111, -18446744073709551615)
 
 def test_main():
-    test_support.run_unittest(TextHexOctBin)
+    test_support.run_unittest(TestHexOctBin)
 
 if __name__ == "__main__":
     test_main()
index 55dd32c7e013415e0a86f39415416ecbe57585e5..757edd6c2f16b7c4fac5f7c01ee65ac0d5755b8e 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import verbose, run_unittest
+from test import test_support
 import unittest
 import nis
 
@@ -8,8 +8,10 @@ class NisTests(unittest.TestCase):
             maps = nis.maps()
         except nis.error as msg:
             # NIS is probably not active, so this test isn't useful
-            if verbose:
-                self.fail("(failing because of verbose mode) %s" % msg)
+            if test_support.verbose:
+                print("Test Skipped:", msg)
+            # Can't raise TestSkipped as regrtest only recognizes the exception
+            #   import time.
             return
         try:
             # On some systems, this map is only accessible to the
@@ -35,7 +37,7 @@ class NisTests(unittest.TestCase):
                 break
 
 def test_main():
-    run_unittest(NisTests)
+    test_support.run_unittest(NisTests)
 
 if __name__ == '__main__':
     test_main()
index 13f8f9eed66db6c0f93398ced840e9d54dea988a..57e9d15afe5c9d1fd35f6caad93cdfe2625a2d96 100644 (file)
@@ -9,6 +9,7 @@ except ImportError:
 
 import time
 import os
+import pwd
 import unittest
 import warnings
 warnings.filterwarnings('ignore', '.* potential security risk .*',
@@ -141,6 +142,33 @@ class PosixTester(unittest.TestCase):
         if hasattr(posix, 'stat'):
             self.assert_(posix.stat(test_support.TESTFN))
 
+    if hasattr(posix, 'chown'):
+        def test_chown(self):
+            # raise an OSError if the file does not exist
+            os.unlink(test_support.TESTFN)
+            self.assertRaises(OSError, posix.chown, test_support.TESTFN, -1, -1)
+
+            # re-create the file
+            open(test_support.TESTFN, 'w').close()
+            if os.getuid() == 0:
+                try:
+                    # Many linux distros have a nfsnobody user as MAX_UID-2
+                    # that makes a good test case for signedness issues.
+                    #   http://bugs.python.org/issue1747858
+                    # This part of the test only runs when run as root.
+                    # Only scary people run their tests as root.
+                    ent = pwd.getpwnam('nfsnobody')
+                    posix.chown(test_support.TESTFN, ent.pw_uid, ent.pw_gid)
+                except KeyError:
+                    pass
+            else:
+                # non-root cannot chown to root, raises OSError
+                self.assertRaises(OSError, posix.chown,
+                                  test_support.TESTFN, 0, 0)
+
+            # test a successful chown call
+            posix.chown(test_support.TESTFN, os.getuid(), os.getgid())
+
     def test_chdir(self):
         if hasattr(posix, 'chdir'):
             posix.chdir(os.curdir)
index baeab3da49c7ac192ba08606501d66f29497306c..10ef60a7efe8617b71d4e885257dc1d43a2a0692 100644 (file)
@@ -12,8 +12,6 @@ except ImportError:
     # 2.x
     from StringIO import StringIO
 
-from contextlib import contextmanager
-
 NotDefined = object()
 
 # A dispatch table all 8 combinations of providing
@@ -40,15 +38,6 @@ dispatch = {
      lambda args, sep, end, file: print(sep=sep, end=end, file=file, *args),
     }
 
-@contextmanager
-def stdout_redirected(new_stdout):
-    save_stdout = sys.stdout
-    sys.stdout = new_stdout
-    try:
-        yield None
-    finally:
-        sys.stdout = save_stdout
-
 # Class used to test __str__ and print
 class ClassWith__str__:
     def __init__(self, x):
@@ -69,8 +58,7 @@ class TestPrint(unittest.TestCase):
                        end is not NotDefined,
                        file is not NotDefined)]
 
-        t = StringIO()
-        with stdout_redirected(t):
+        with test_support.captured_stdout() as t:
             fn(args, sep, end, file)
 
         self.assertEqual(t.getvalue(), expected)
index 7cdc27534f386ebb5a4d516aceafed430e86edc0..dac569c96282331cf7e81a4820ea0f8689bf2912 100644 (file)
@@ -23,25 +23,27 @@ class BeepTest(unittest.TestCase):
         self.assertRaises(ValueError, winsound.Beep, 32768, 75)
 
     def test_extremes(self):
-        if _have_soundcard():
-            winsound.Beep(37, 75)
-            winsound.Beep(32767, 75)
-        else:
-            # The behaviour of winsound.Beep() seems to differ between
-            # different versions of Windows when there's either a) no
-            # sound card entirely, b) legacy beep driver has been disabled,
-            # or c) the legacy beep driver has been uninstalled.  Sometimes
-            # RuntimeErrors are raised, sometimes they're not.  Meh.
-            try:
-                winsound.Beep(37, 75)
-                winsound.Beep(32767, 75)
-            except RuntimeError:
-                pass
+        self._beep(37, 75)
+        self._beep(32767, 75)
 
     def test_increasingfrequency(self):
-        if _have_soundcard():
-            for i in range(100, 2000, 100):
-                winsound.Beep(i, 75)
+        for i in xrange(100, 2000, 100):
+            self._beep(i, 75)
+
+    def _beep(self, *args):
+        # these tests used to use _have_soundcard(), but it's quite
+        # possible to have a soundcard, and yet have the beep driver
+        # disabled. So basically, we have no way of knowing whether
+        # a beep should be produced or not, so currently if these
+        # tests fail we're ignoring them
+        #
+        # XXX the right fix for this is to define something like
+        # _have_enabled_beep_driver() and use that instead of the
+        # try/except below
+        try:
+            winsound.Beep(*args)
+        except RuntimeError:
+            pass
 
 class MessageBeepTest(unittest.TestCase):
 
index 0adf507c84920d2206ef7bc4f8e9062173871a44..d2fd504e864a03bc586d699975b08beb0264cf45 100644 (file)
@@ -1,6 +1,7 @@
 import unittest
 from test import test_support
 import zlib
+import binascii
 import random
 
 
@@ -46,6 +47,12 @@ class ChecksumTestCase(unittest.TestCase):
         self.assertEqual(zlib.adler32(foo+foo), 3573550353)
         self.assertEqual(zlib.adler32('spam'), 72286642)
 
+    def test_same_as_binascii_crc32(self):
+        foo = 'abcdefghijklmnop'
+        crc = -1808088941
+        self.assertEqual(binascii.crc32(foo), crc)
+        self.assertEqual(zlib.crc32(foo), crc)
+        self.assertEqual(binascii.crc32('spam'), zlib.crc32('spam'))
 
 
 
index 2865c0a2c16aa7ad4dc4cecfeea9275dbfc052e1..719ed445fc139f494d9cedf20993d0dc8ecbc4e0 100644 (file)
@@ -8,8 +8,10 @@ import binascii, io
 
 try:
     import zlib # We may need its compression method
+    crc32 = zlib.crc32
 except ImportError:
     zlib = None
+    crc32 = binascii.crc32
 
 __all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED", "is_zipfile",
            "ZipInfo", "ZipFile", "PyZipFile", "LargeZipFile" ]
@@ -36,13 +38,13 @@ ZIP_DEFLATED = 8
 # Here are some struct module formats for reading headers
 structEndArchive = "<4s4H2LH"     # 9 items, end of archive, 22 bytes
 stringEndArchive = b"PK\005\006"   # magic number for end of archive record
-structCentralDir = "<4s4B4HlLL5HLL"# 19 items, central directory, 46 bytes
+structCentralDir = "<4s4B4HLLL5HLL"# 19 items, central directory, 46 bytes
 stringCentralDir = b"PK\001\002"   # magic number for central directory
-structFileHeader = "<4s2B4HlLL2H"  # 12 items, file header record, 30 bytes
+structFileHeader = "<4s2B4HLLL2H"  # 12 items, file header record, 30 bytes
 stringFileHeader = b"PK\003\004"   # magic number for file header
-structEndArchive64Locator = "<4slql" # 4 items, locate Zip64 header, 20 bytes
+structEndArchive64Locator = "<4sLQL" # 4 items, locate Zip64 header, 20 bytes
 stringEndArchive64Locator = b"PK\x06\x07" # magic token for locator header
-structEndArchive64 = "<4sqhhllqqqq" # 10 items, end of archive (Zip64), 56 bytes
+structEndArchive64 = "<4sQHHLLQQQQ" # 10 items, end of archive (Zip64), 56 bytes
 stringEndArchive64 = b"PK\x06\x06" # magic token for Zip64 header
 
 
@@ -140,7 +142,7 @@ def _EndRecData(fpin):
         endrec = list(endrec)
         endrec.append("")               # Append the archive comment
         endrec.append(filesize - 22)    # Append the record start offset
-        if endrec[-4] == -1 or endrec[-4] == 0xffffffff:
+        if endrec[-4] == 0xffffffff:
             return _EndRecData64(fpin, -22, endrec)
         return endrec
     # Search the last END_BLOCK bytes of the file for the record signature.
@@ -160,7 +162,7 @@ def _EndRecData(fpin):
             # Append the archive comment and start offset
             endrec.append(comment)
             endrec.append(filesize - END_BLOCK + start)
-            if endrec[-4] == -1 or endrec[-4] == 0xffffffff:
+            if endrec[-4] == 0xffffffff:
                 return _EndRecData64(fpin, - END_BLOCK + start, endrec)
             return endrec
     return      # Error, return None
@@ -247,7 +249,7 @@ class ZipInfo (object):
         if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
             # File is larger than what fits into a 4 byte integer,
             # fall back to the ZIP64 extension
-            fmt = '<hhqq'
+            fmt = '<HHQQ'
             extra = extra + struct.pack(fmt,
                     1, struct.calcsize(fmt)-4, file_size, compress_size)
             file_size = 0xffffffff # -1
@@ -267,14 +269,14 @@ class ZipInfo (object):
         extra = self.extra
         unpack = struct.unpack
         while extra:
-            tp, ln = unpack('<hh', extra[:4])
+            tp, ln = unpack('<HH', extra[:4])
             if tp == 1:
                 if ln >= 24:
-                    counts = unpack('<qqq', extra[4:28])
+                    counts = unpack('<QQQ', extra[4:28])
                 elif ln == 16:
-                    counts = unpack('<qq', extra[4:20])
+                    counts = unpack('<QQ', extra[4:20])
                 elif ln == 8:
-                    counts = unpack('<q', extra[4:12])
+                    counts = unpack('<Q', extra[4:12])
                 elif ln == 0:
                     counts = ()
                 else:
@@ -283,7 +285,8 @@ class ZipInfo (object):
                 idx = 0
 
                 # ZIP64 extension (large files and/or large archives)
-                if self.file_size == -1 or self.file_size == 0xFFFFFFFF:
+                # XXX Is this correct? won't this exclude 2**32-1 byte files?
+                if self.file_size in (0xffffffffffffffff, 0xffffffff):
                     self.file_size = counts[idx]
                     idx += 1
 
@@ -950,7 +953,7 @@ class ZipFile:
             if not buf:
                 break
             file_size = file_size + len(buf)
-            CRC = binascii.crc32(buf, CRC)
+            CRC = crc32(buf, CRC) & 0xffffffff
             if cmpr:
                 buf = cmpr.compress(buf)
                 compress_size = compress_size + len(buf)
@@ -968,7 +971,7 @@ class ZipFile:
         # Seek backwards and write CRC and file sizes
         position = self.fp.tell()       # Preserve current position in file
         self.fp.seek(zinfo.header_offset + 14, 0)
-        self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
+        self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size,
               zinfo.file_size))
         self.fp.seek(position, 0)
         self.filelist.append(zinfo)
@@ -997,7 +1000,7 @@ class ZipFile:
         zinfo.header_offset = self.fp.tell()    # Start of header data
         self._writecheck(zinfo)
         self._didModify = True
-        zinfo.CRC = binascii.crc32(data)       # CRC-32 checksum
+        zinfo.CRC = crc32(data) & 0xffffffff       # CRC-32 checksum
         if zinfo.compress_type == ZIP_DEFLATED:
             co = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
                  zlib.DEFLATED, -15)
@@ -1047,7 +1050,7 @@ class ZipFile:
 
                 if zinfo.header_offset > ZIP64_LIMIT:
                     extra.append(zinfo.header_offset)
-                    header_offset = -1  # struct "l" format:  32 one bits
+                    header_offset = 0xffffffff  # -1 32 bit
                 else:
                     header_offset = zinfo.header_offset
 
@@ -1055,7 +1058,7 @@ class ZipFile:
                 if extra:
                     # Append a ZIP64 field to the extra's
                     extra_data = struct.pack(
-                            '<hh' + 'q'*len(extra),
+                            '<HH' + 'Q'*len(extra),
                             1, 8*len(extra), *extra) + extra_data
 
                     extract_version = max(45, zinfo.extract_version)
@@ -1064,14 +1067,25 @@ class ZipFile:
                     extract_version = zinfo.extract_version
                     create_version = zinfo.create_version
 
-                centdir = struct.pack(structCentralDir,
-                  stringCentralDir, create_version,
-                  zinfo.create_system, extract_version, zinfo.reserved,
-                  zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
-                  zinfo.CRC, compress_size, file_size,
-                  len(zinfo.filename), len(extra_data), len(zinfo.comment),
-                  0, zinfo.internal_attr, zinfo.external_attr,
-                  header_offset)
+                try:
+                    centdir = struct.pack(structCentralDir,
+                     stringCentralDir, create_version,
+                     zinfo.create_system, extract_version, zinfo.reserved,
+                     zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
+                     zinfo.CRC, compress_size, file_size,
+                     len(zinfo.filename), len(extra_data), len(zinfo.comment),
+                     0, zinfo.internal_attr, zinfo.external_attr,
+                     header_offset)
+                except DeprecationWarning:
+                    print >>sys.stderr, (structCentralDir,
+                     stringCentralDir, create_version,
+                     zinfo.create_system, extract_version, zinfo.reserved,
+                     zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
+                     zinfo.CRC, compress_size, file_size,
+                     len(zinfo.filename), len(extra_data), len(zinfo.comment),
+                     0, zinfo.internal_attr, zinfo.external_attr,
+                     header_offset)
+                    raise
                 self.fp.write(centdir)
                 self.fp.write(zinfo.filename.encode("utf-8"))
                 self.fp.write(extra_data)
@@ -1091,10 +1105,8 @@ class ZipFile:
                         stringEndArchive64Locator, 0, pos2, 1)
                 self.fp.write(zip64locrec)
 
-                # XXX Why is `pos3` computed next?  It's never referenced.
-                pos3 = self.fp.tell()
                 endrec = struct.pack(structEndArchive, stringEndArchive,
-                            0, 0, count, count, pos2 - pos1, -1, 0)
+                            0, 0, count, count, pos2 - pos1, 0xffffffff, 0)
                 self.fp.write(endrec)
 
             else:
index 8d3111392087fd177cbb4b51d7298d07a9c84703..dbc86df634c6d6ac29dae413b28989bb20029a69 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -736,6 +736,7 @@ Lars Wirzenius
 Stefan Witzel
 Klaus-Juergen Wolf
 Dan Wolfe
+David Wolever
 Richard Wolff
 Gordon Worley
 Thomas Wouters
index 7c9df3394f087c0bb03cbf79e5425c60a3c667a7..d161e76d249975fba0552ecf2100f0817c9949e1 100644 (file)
@@ -17,6 +17,8 @@ the format to accommodate documentation needs as they arise.
 Permissions History
 -------------------
 
+- Jeff Rush was given SVN access on 18 March 2008 by AMK, for Distutils work.
+
 - David Wolever was given SVN access on 17 March 2008 by MvL,
   for 2to3 work.
 
index 5f8705dc4e9028c34b1f4ca88cf8e9e6994e7f46..2b4b352f0dfbec4bb22fd49552fe86266a8cb233 100644 (file)
@@ -902,7 +902,7 @@ binascii_crc32(PyObject *self, PyObject *args)
        Py_ssize_t len;
        long result;
 
-       if ( !PyArg_ParseTuple(args, "s#|l:crc32", &bin_data, &len, &crc) )
+       if ( !PyArg_ParseTuple(args, "s#|k:crc32", &bin_data, &len, &crc) )
                return NULL;
 
        crc = ~ crc;
index 3e91f00b7786cd0a0c3e558d651edece8b4ee288..716bf7d78a140a16ef4b160f2940f5571b637fbb 100644 (file)
@@ -1906,9 +1906,9 @@ static PyObject *
 posix_chown(PyObject *self, PyObject *args)
 {
        char *path = NULL;
-       int uid, gid;
+       long uid, gid;
        int res;
-       if (!PyArg_ParseTuple(args, "etii:chown",
+       if (!PyArg_ParseTuple(args, "etll:chown",
                              Py_FileSystemDefaultEncoding, &path,
                              &uid, &gid))
                return NULL;
index c0298a8aa39a19921339c5085ab7a5c6dae3a5e5..dd05fe116dd4989edaf600db637f319993a7c3b2 100644 (file)
@@ -2600,6 +2600,11 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls)
        static PyObject *name = NULL;
        PyObject *t, *v, *tb;
        PyObject *checker;
+
+       /* Quick test for an exact match */
+       if (Py_TYPE(inst) == (PyTypeObject *)cls)
+               return 1;
+
        PyErr_Fetch(&t, &v, &tb);
 
        if (name == NULL) {
index 490afe0b148549cb7022ffd3bc710a616523dbe8..50a3897f48a23a70095d059beac8d9eb50f8aee2 100644 (file)
@@ -51,6 +51,18 @@ cell_dealloc(PyCellObject *op)
        PyObject_GC_Del(op);
 }
 
+static int
+cell_compare(PyCellObject *a, PyCellObject *b)
+{
+       if (a->ob_ref == NULL) {
+               if (b->ob_ref == NULL)
+                       return 0;
+               return -1;
+       } else if (b->ob_ref == NULL)
+               return 1;
+       return PyObject_Compare(a->ob_ref, b->ob_ref);
+}
+
 static PyObject *
 cell_repr(PyCellObject *op)
 {
@@ -102,7 +114,7 @@ PyTypeObject PyCell_Type = {
        0,                                      /* tp_print */
        0,                                      /* tp_getattr */
        0,                                      /* tp_setattr */
-       0,                                      /* tp_compare */
+       (cmpfunc)cell_compare,                                  /* tp_compare */
        (reprfunc)cell_repr,                    /* tp_repr */
        0,                                      /* tp_as_number */
        0,                                      /* tp_as_sequence */
index 3efdcce0c50d4e0a80ba2fd2b6d451ad874aa208..f9d77e86578733b269ac94ce4cae1823b8f0dd44 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="9,00"
+       Version="9.00"
        Name="_bsddb"
        ProjectGUID="{B4D38F3F-68FB-42EC-A45D-E00657BB3627}"
        RootNamespace="_bsddb"
@@ -42,7 +42,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist Debug\libdb44sd.lib exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Debug|Win32&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)\Debug\libdb44sd.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist &quot;x64\Debug AMD64\db_static.lib&quot; exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Debug AMD64|x64&quot;&#x0D;&#x0A;"
+                               CommandLine=""
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="&quot;$(bsddbDir)x64\Debug AMD64\db_static.lib&quot;"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist Release\libdb44s.lib exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Release|Win32&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)\Release\libdb44s.lib"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist x64\Release AMD64\db_static.lib exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Release AMD64|Win32&quot;&#x0D;&#x0A;"
+                               CommandLine=""
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)x64\Release AMD64\db_static.lib"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist Release\libdb44s.lib exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Release|Win32&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)\Release\libdb44s.lib"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist &quot;x64\Release AMD64\db_static.lib&quot; exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Release AMD64|Win32&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)x64\Release AMD64\db_static.lib"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                                TargetMachine="17"
                        />
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist Release\libdb44s.lib exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Release|Win32&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)\Release\libdb44s.lib"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(bsddbDir)"
+                               AdditionalIncludeDirectories="$(bsddbDir),$(bsddbDir)\.."
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               CommandLine="cd $(bsddbDir)&#x0D;&#x0A;if exist x64\Release AMD64\db_static.lib exit 0&#x0D;&#x0A;vcbuild /useenv db_static.vcproj &quot;Release AMD64|Win32&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(bsddbDir)x64\Release AMD64\db_static.lib"
+                               AdditionalDependencies="$(bsddbDepLibs)"
                                BaseAddress="0x1e180000"
                                TargetMachine="17"
                        />
index 646c5453fc2420ad95adcaa9395c6a81e9046208..19d549752df128b22d408460e3967f6164e5dbdd 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="9,00"
+       Version="9.00"
        Name="_sqlite3"
        ProjectGUID="{13CECB97-4119-4316-9D42-8534019A5A44}"
        RootNamespace="_sqlite3"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                                TargetMachine="17"
                        />
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="Build sqlite3 libs and dll"
-                               CommandLine="cd &quot;$(sqlite3Dir)&quot;&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; if exist $(PlatformName)\sqlite3.dll copy $(PlatformName)\sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;if exist $(PlatformName)\sqlite3.lib exit 0&#x0D;&#x0A;if not exist $(PlatformName) mkdir $(PlatformName)&#x0D;&#x0A;cd $(PlatformName)&#x0D;&#x0A;cl /DNO_TCL /Ox /Ob1 /Oi /GL /GF /FD /MD /Gy ..\*.c&#x0D;&#x0A;link /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /def:..\sqlite3.def  /dll /out:sqlite3.dll *.obj&#x0D;&#x0A;if not exist &quot;$(OutDir)\sqlite3.dll&quot; copy sqlite3.dll &quot;$(OutDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(sqlite3Dir)\$(PlatformName)\sqlite3.lib"
                                BaseAddress="0x1e180000"
                                TargetMachine="17"
                        />
index e3baa5cee17da484a94f14b6f94124c53a3089b7..e8f8aa5ed3ca753f7ac3e1ca6cd99b70c88f8857 100644 (file)
@@ -56,7 +56,7 @@
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(tcltkLib)"
+                               AdditionalDependencies="$(tcltkLibDebug)"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="&quot;$(tcltk64Dir)\include&quot;"
+                               AdditionalIncludeDirectories="$(tcltk64Dir)\include"
                                PreprocessorDefinitions="WITH_APPINIT"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="$(tcltk64Lib)"
+                               AdditionalDependencies="$(tcltk64LibDebug)"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="&quot;$(tcltk64Dir)\include&quot;"
+                               AdditionalIncludeDirectories="$(tcltk64Dir)\include"
                                PreprocessorDefinitions="WITH_APPINIT"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="&quot;$(tcltk64Dir)\include&quot;"
+                               AdditionalIncludeDirectories="$(tcltk64Dir)\include"
                                PreprocessorDefinitions="WITH_APPINIT"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="&quot;$(tcltk64Dir)\include&quot;"
+                               AdditionalIncludeDirectories="$(tcltk64Dir)\include"
                                PreprocessorDefinitions="WITH_APPINIT"
                        />
                        <Tool
index 69c4a83a837736eb83dc874f42efe7efca1cfe1e..6838d6264360c6414d6c990b3eb82612ac6173be 100644 (file)
@@ -36,6 +36,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcproj
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bsddb", "_bsddb.vcproj", "{B4D38F3F-68FB-42EC-A45D-E00657BB3627}"
        ProjectSection(ProjectDependencies) = postProject
+               {62172C7D-B39E-409A-B352-370FF5098C19} = {62172C7D-B39E-409A-B352-370FF5098C19}
                {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
        EndProjectSection
 EndProject
@@ -67,6 +68,7 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcproj", "{13CECB97-4119-4316-9D42-8534019A5A44}"
        ProjectSection(ProjectDependencies) = postProject
                {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
+               {A1A295E5-463C-437F-81CA-1F32367685DA} = {A1A295E5-463C-437F-81CA-1F32367685DA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}"
@@ -114,6 +116,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcproj
                {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bsddb44", "_bsddb44.vcproj", "{62172C7D-B39E-409A-B352-370FF5098C19}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -486,6 +492,38 @@ Global
                {447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|Win32.Build.0 = Release|Win32
                {447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|x64.ActiveCfg = Release|x64
                {447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|x64.Build.0 = Release|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Debug|Win32.ActiveCfg = Debug|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Debug|Win32.Build.0 = Debug|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Debug|x64.ActiveCfg = Debug|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Debug|x64.Build.0 = Debug|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGInstrument|x64.Build.0 = PGInstrument|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.PGUpdate|x64.Build.0 = PGUpdate|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Release|Win32.ActiveCfg = Release|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Release|Win32.Build.0 = Release|Win32
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Release|x64.ActiveCfg = Release|x64
+               {62172C7D-B39E-409A-B352-370FF5098C19}.Release|x64.Build.0 = Release|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|Win32.ActiveCfg = Debug|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|Win32.Build.0 = Debug|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|x64.ActiveCfg = Debug|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|x64.Build.0 = Debug|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|x64.Build.0 = PGInstrument|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|x64.Build.0 = PGUpdate|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|Win32.ActiveCfg = Release|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|Win32.Build.0 = Release|Win32
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|x64.ActiveCfg = Release|x64
+               {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 54819e883bf08b42289c49d29b8d2ebf6ec75001..ccf579dcabd7db1f645d28815a7fb897340a9fa7 100644 (file)
        />
        <UserMacro
                Name="bsddbDir"
-               Value="..\..\db-4.4.20\build_win32\"
+               Value="$(bsddb44Dir)"
+       />
+       <UserMacro
+               Name="bsddbDepLibs"
+               Value="$(bsddb44DepLibs)"
+       />
+       <UserMacro
+               Name="bsddb44Dir"
+               Value="..\..\db-4.4.20\build_win32"
+       />
+       <UserMacro
+               Name="bsddb44DepLibs"
+               Value=""
+       />
+       <UserMacro
+               Name="bsddb45Dir"
+               Value="..\..\db-4.5.20.x\build_windows"
+       />
+       <UserMacro
+               Name="bsddb45DepLibs"
+               Value="ws2_32.lib"
        />
        <UserMacro
                Name="sqlite3Dir"
-               Value="..\..\sqlite-source-3.3.4\"
+               Value="..\..\sqlite-source-3.3.4"
        />
        <UserMacro
                Name="bz2Dir"
-               Value="..\..\bzip2-1.0.3\"
+               Value="..\..\bzip2-1.0.3"
        />
        <UserMacro
                Name="opensslDir"
-               Value="..\..\openssl-0.9.8g\"
+               Value="..\..\openssl-0.9.8g"
        />
        <UserMacro
                Name="tcltkDir"
-               Value="..\..\tcltk\"
+               Value="..\..\tcltk"
        />
        <UserMacro
                Name="tcltk64Dir"
                Name="tcltkLib"
                Value="$(tcltkDir)\lib\tcl84.lib $(tcltkDir)\lib\tk84.lib"
        />
+       <UserMacro
+               Name="tcltkLibDebug"
+               Value="$(tcltkDir)\lib\tcl84g.lib $(tcltkDir)\lib\tk84g.lib"
+       />
        <UserMacro
                Name="tcltk64Lib"
                Value="$(tcltk64Dir)\lib\tcl84.lib $(tcltk64Dir)\lib\tk84.lib"
        />
+       <UserMacro
+               Name="tcltk64LibDebug"
+               Value="$(tcltk64Dir)\lib\tcl84g.lib $(tcltk64Dir)\lib\tk84g.lib"
+       />
 </VisualStudioPropertySheet>
index d5d84f74b8b27d2cdf9f2dc37d933d8b8b478cdf..be25ac3613f80ca060c97d53d2ab96909f27311c 100644 (file)
@@ -2386,10 +2386,6 @@ ast_for_import_stmt(struct compiling *c, const node *n)
             /* from ... import * */
             n = CHILD(n, idx);
             n_children = 1;
-            if (ndots) {
-                ast_error(n, "'import *' not allowed with 'from .'");
-                return NULL;
-            }
             break;
         case LPAR:
             /* from ... import (x, y, z) */
index 0ea4d64160737af0263388c72d68e6ee5573dd6e..8fd452a011aa8e40653187c769b42572fbe4ea2a 100644 (file)
@@ -1,48 +1,17 @@
 @rem Fetches (and builds if necessary) external dependencies
 
-@REM XXX FIXME - building for x64 disabled for now.
-
 @rem Assume we start inside the Python source directory
-cd ..
-call "%VS90COMNTOOLS%vsvars32.bat"
-
-@rem bzip
-if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3
-
-@rem Sleepycat db
-@rem Remove VS 2003 builds
-if exist db-4.4.20 if not exist db-4.4.20\build_win32\this_is_for_vs9 (
-   echo Removing old build
-   rd /s/q db-4.4.20
-)
-if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20-vs9 db-4.4.20
-if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
-   vcbuild db-4.4.20\build_win32\db_static.vcproj "Debug AMD64|x64"
-)
+call "Tools\buildbot\external-common.bat"
+call "%VS90COMNTOOLS%\vsvars32.bat"
 
-@rem OpenSSL
-if not exist openssl-0.9.8g (
-  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a
-  svn export http://svn.python.org/projects/external/openssl-0.9.8g
+if not exist tcltk64\bin\tcl84g.dll (
+    cd tcl-8.4.18.2\win
+    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk64 clean all install
+    cd ..\..
 )
 
-@rem tcltk
-if not exist tcl8.4.16 (
-   if exist tcltk rd /s/q tcltk
-   if exist tcl8.4.12 rd /s/q tcl8.4.12
-   if exist tk8.4.12 rd /s/q tk8.4.12
-   svn export http://svn.python.org/projects/external/tcl8.4.16
-   svn export http://svn.python.org/projects/external/tk8.4.16
-@REM    cd tcl8.4.16\win
-@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
-@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
-@REM    cd ..\..
-@REM    cd tk8.4.16\win
-@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
-@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
-@REM    cd ..\..
+if not exist tcltk64\bin\tk84g.dll (
+    cd tk-8.4.18.1\win    
+    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.4.18.2 clean all install
+    cd ..\..
 )
-
-@rem sqlite
-if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
-@REM if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild
index ae18ead3858edd21809fd1a0bbe0f888f5dee367..411360560011a43d39d18223127f4e1fec77d6a3 100644 (file)
@@ -1,46 +1,17 @@
 @rem Fetches (and builds if necessary) external dependencies\r
 \r
 @rem Assume we start inside the Python source directory\r
-cd ..\r
-call "%VS90COMNTOOLS%vsvars32.bat"\r
+call "Tools\buildbot\external-common.bat"\r
+call "%VS90COMNTOOLS%\vsvars32.bat"\r
 \r
-@rem bzip\r
-if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3\r
-\r
-@rem Sleepycat db\r
-@rem Remove VS 2003 builds\r
-if exist db-4.4.20 if not exist db-4.4.20\build_win32\this_is_for_vs9 (\r
-   echo Removing old build\r
-   rd /s/q db-4.4.20\r
-)\r
-if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20-vs9 db-4.4.20\r
-if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (\r
-   vcbuild db-4.4.20\build_win32\db_static.vcproj "Debug|Win32"\r
+if not exist tcltk\bin\tcl84g.dll (\r
+    cd tcl-8.4.18.2\win\r
+    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all install\r
+    cd ..\..\r
 )\r
 \r
-@rem OpenSSL\r
-if not exist openssl-0.9.8g (\r
-  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a\r
-  svn export http://svn.python.org/projects/external/openssl-0.9.8g\r
+if not exist tcltk\bin\tk84g.dll (\r
+    cd tk-8.4.18.1\win    \r
+    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.4.18.2 clean all install\r
+    cd ..\..\r
 )\r
-\r
-@rem tcltk\r
-if not exist tcl8.4.16 (\r
-   if exist tcltk rd /s/q tcltk\r
-   if exist tcl8.4.12 rd /s/q tcl8.4.12\r
-   if exist tk8.4.12 rd /s/q tk8.4.12\r
-   svn export http://svn.python.org/projects/external/tcl8.4.16\r
-   svn export http://svn.python.org/projects/external/tk8.4.16\r
-   cd tcl8.4.16\win\r
-   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500\r
-   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install\r
-   cd ..\..\r
-   cd tk8.4.16\win\r
-   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16\r
-   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install\r
-   cd ..\..\r
-)\r
-\r
-@rem sqlite\r
-if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4\r
-if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild\r