Commit Graph

38788 Commits

Author SHA1 Message Date
Georg Brandl 80055f6295 #2355: py3k warning for buffer(). 2008-03-25 07:56:27 +00:00
Gregory P. Smith aef3e529e2 On platforms without zlib, make this do the right thing and return the python
2.x signed value.  Also, don't waste space on a table full of unsigned longs
when all it needs are unsigned ints (incase anyone builds this without zlib on
a 64-bit unix for some strange reason).

tested by forcing it to compile this version on both 32-bit and 64-bit linux.
2008-03-25 07:46:07 +00:00
Gregory P. Smith 1fa588e14f Use a 32-bit unsigned int here, a long is not needed. 2008-03-25 07:31:28 +00:00
Georg Brandl 18f1914a02 #868845: document <...> reprs. 2008-03-25 07:20:15 +00:00
Neal Norwitz bb89e686e3 Try to get this test to be more stable:
* disable gc during the test run because we are spawning objects and there
   was an exception when calling Popen.__del__
 * Always set an alarm handler so the process doesn't exit if the test fails
   (should probably add assertions on the value of hndl_called in more places)
 * Using a negative time causes Linux to treat it as zero, so disable that test.
2008-03-25 07:00:39 +00:00
Neal Norwitz be9160b035 Don't try to close a non-open file.
Don't let file removal cause the test to fail.
2008-03-25 06:35:10 +00:00
Gregory P. Smith 88440960f9 A stab in the dark attempt to fix the alpha/tru64 buildbot problem and add more
test coverage of valid inputs to zlib.crc32.
2008-03-25 06:12:45 +00:00
Neal Norwitz 4677fbf7de Try to fix a bunch of compiler warnings on Win64. 2008-03-25 04:18:18 +00:00
Neal Norwitz 40f5e4c5a2 Fix a bunch of UnboundLocalErrors when the tests fail. 2008-03-25 04:17:38 +00:00
Amaury Forgeot d'Arc fac02faed8 Issue2469: Correct a typo I introduced at r61793: compilation error with UCS4 builds.
All buildbots compile with UCS2...
2008-03-24 21:04:10 +00:00
Christian Heimes a113bd9f69 Added quick hack for bzr 2008-03-24 19:58:17 +00:00
Christian Heimes 6a453c3750 Added quick hack for bzr 2008-03-24 19:57:42 +00:00
Martin v. Löwis b74d084da8 Conditionalize sys/time.h inclusion. 2008-03-24 13:54:23 +00:00
Martin v. Löwis aef18b1c67 Patch #2240: Implement signal.setitimer and signal.getitimer. 2008-03-24 13:31:16 +00:00
Martin v. Löwis cdbc977c03 Install 2to3 script. 2008-03-24 12:57:53 +00:00
Georg Brandl 9bdead0aed #1700821: add a note to audioop docs about signedness of sample formats. 2008-03-24 09:34:34 +00:00
Raymond Hettinger b72233ce63 Issue 2460: Make Ellipsis objects copyable. 2008-03-24 08:17:39 +00:00
Raymond Hettinger d145240f9a Tighten documentation for Random.triangular. 2008-03-24 06:07:49 +00:00
Martin v. Löwis 966d0e0930 Merged revisions 61724-61824 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r61730 | martin.v.loewis | 2008-03-22 02:20:58 +0100 (Sa, 22 Mär 2008) | 2 lines

  More explicit relative imports.
........
  r61755 | david.wolever | 2008-03-22 21:33:52 +0100 (Sa, 22 Mär 2008) | 1 line

  Fixing #2446 -- 2to3 now translates 'import foo' to 'from . import foo'
........
  r61824 | david.wolever | 2008-03-24 01:30:24 +0100 (Mo, 24 Mär 2008) | 3 lines

  Fixed a bug where 'from itertools import izip' would return 'from itertools import'
........
2008-03-24 00:46:53 +00:00
Gregory P. Smith 440ca772f3 Have the binascii module use zlib's optimized crc32() function when available
to reduce our code size (1k data table and tiny bit of code).  It falls back
to its own without zlib.
2008-03-24 00:08:01 +00:00
Gregory P. Smith dd10284516 prevent a warning from the struct module when data size >= 2**32. 2008-03-23 23:45:12 +00:00
Gregory P. Smith ac830e932d A bugfix for r61813, it would fail if the data size was >=2**32. 2008-03-23 23:43:02 +00:00
Gregory P. Smith be446b4ab7 replace calls to get the initial values with the raw constants. 2008-03-23 22:14:38 +00:00
Gregory P. Smith 79b4ba8fd7 Fix gzip to deal with CRC's being signed values in Python 2.x properly and to
read 32bit values as unsigned to start with rather than applying signedness
fixups allover the place afterwards.

This hopefully fixes the test_tarfile failure on the alpha/tru64 buildbot.
2008-03-23 21:04:43 +00:00
Gregory P. Smith 73f57b0c05 Revert r61779 - It undid correct code and caused test_zlib to fail on all
platforms with a 64-bit long.

The Alpha/Tru64 test problem is a problem in either tarfile or test_tarfile,
not zlib.

crc32 and adler32 return 32-bit values.  by using a long thats larger than
32-bits in these functions they were prevented from wrapping around to their
signed 32-bit value that we want them to return in python 2.x.
2008-03-23 20:31:23 +00:00
Raymond Hettinger c4f7bab0a0 Adopt Nick's suggestion for useful default arguments.
Clean-up floating point issues by adding true division and float constants.
2008-03-23 19:37:53 +00:00
Raymond Hettinger bbc50eafe5 Issue 1681432: Add triangular distribution the random module. 2008-03-23 13:32:32 +00:00
Amaury Forgeot d'Arc 9a0d3462fc #1477: ur'\U0010FFFF' raised in narrow unicode builds.
Corrected the raw-unicode-escape codec to use UTF-16 surrogates in
this case, just like the unicode-escape codec.
2008-03-23 09:55:29 +00:00
Georg Brandl 61854332b9 Make the doctests presentation-friendlier. 2008-03-23 08:05:30 +00:00
Neal Norwitz ade57d0485 Remove compiler warnings (on Alpha at least) about using chars as
array subscripts.  Using chars are dangerous b/c they are signed
on some platforms and unsigned on others.
2008-03-23 06:19:57 +00:00
Neal Norwitz acdb6fb2a5 Try to prevent the alarm going off early in tearDown 2008-03-23 06:16:04 +00:00
Neal Norwitz 0d2192be8b Move itertools before future_builtins since the latter depends on the former.
From a clean build importing future_builtins would fail since itertools
wasn't built yet.
2008-03-23 06:13:25 +00:00
Neal Norwitz 41d649116c Suppress failure (to avoid a flaky test) if we cannot connect to svn.python.org 2008-03-23 05:47:20 +00:00
Neal Norwitz acbd6420e3 Fix test_tarfile failures on Alpha (Tru64). The problem was caused in r61449
which made the return value signed.  On the Alpha that also lost data
since sizeof(int) != sizeof(long) and apparently adler32/crc32 return
64 bits of data.  This change keeps the signedness and continues to store the
data in a long rather than an int as was the case before r61449.
2008-03-23 05:08:37 +00:00
Neal Norwitz 3bda069c5a Skip the epoll test if epoll() does not work 2008-03-23 04:43:09 +00:00
Neal Norwitz 162d719113 Speed up the test by avoiding socket timeouts. 2008-03-23 04:08:30 +00:00
Neal Norwitz 1f2995b014 Try to make this test a little more robust and not fail with:
timeout (10.0025) is more than 2 seconds more than expected (0.001)

I'm assuming this problem is caused by DNS lookup.  This change
does a DNS lookup of the hostname before trying to connect, so the time
is not included.
2008-03-23 03:43:33 +00:00
Raymond Hettinger e70bb8d6f2 Simplify demo code. 2008-03-23 00:55:46 +00:00
Georg Brandl e8f1b00372 Enable doctest running for several other documents.
We have now over 640 doctests that are run with "make doctest".
2008-03-22 22:04:10 +00:00
Georg Brandl 7a45ab826e Enable doctests in functions.rst. Already found two errors :) 2008-03-22 21:38:33 +00:00
Georg Brandl 4f0f34f131 Test doctests in operator docs. 2008-03-22 21:26:44 +00:00
Georg Brandl 3f04303ba4 Test doctests in datetime docs. 2008-03-22 21:21:57 +00:00
Georg Brandl 4c8bbe69e5 Make collections' doctests executable.
(The <BLANKLINE>s will be stripped from presentation output.)
2008-03-22 21:06:20 +00:00
Georg Brandl 3dd57815b2 Fix-up syntax problems. 2008-03-22 20:08:43 +00:00
Georg Brandl 838b4b0145 No need to specify explicit "doctest_block" anymore. 2008-03-22 13:07:06 +00:00
Georg Brandl 473f1642a4 Make more doctests in pprint docs testable. 2008-03-22 12:59:37 +00:00
Georg Brandl 6199e32a74 Make doctests in re docs usable with sphinx' doctest. 2008-03-22 12:04:26 +00:00
Georg Brandl 9f6623255b Test decimal.rst doctests as far as possible with sphinx doctest. 2008-03-22 11:47:10 +00:00
Georg Brandl 09a7fe6933 Fixup this HOWTO's doctest blocks so that they can be run with sphinx' doctest builder. 2008-03-22 11:00:48 +00:00
Georg Brandl b98fe5a87f Allow giving source names on the cmdline. 2008-03-22 10:58:38 +00:00