Commit Graph

12911 Commits

Author SHA1 Message Date
Georg Brandl fc8eef3c78 Patch #1810 by Thomas Lee, reviewed by myself:
allow compiling Python AST objects into code objects
in compile().
2008-03-28 12:11:56 +00:00
Gregory P. Smith b9803421d2 Accept patch issue2426 by Paul Kippes (kippesp).
Adds sqlite3.Connection.iterdump to allow dumping of databases.
2008-03-28 08:32:09 +00:00
Gregory P. Smith 0001c2ecbc This patch moves some tests from test_urllib2_net to test_urllib2_localnet.
The moved tests use a local server rather than going out to external servers.

Accepts patch from issue2429.

Contributed by Jerry Seutter & Michael Foord (fuzzyman) at PyCon 2008.
2008-03-28 08:00:44 +00:00
Neal Norwitz ab364c4366 Name the main method correctly so the test is run 2008-03-28 07:36:31 +00:00
Neal Norwitz 70cea58c84 Bug 1503: Get the test to pass on OSX. This should make the test more
reliable, but I'm not convinced it is the right solution.  We need
to determine if this causes the test to hang on any platforms or do
other bad things.

Even if it gets the test to pass reliably, it might be that we want
to fix this in socket.  The socket returned from accept() is different
on different platforms (inheriting attributes or not) and we might
want to ensure that the attributes (at least blocking) is the same
across all platforms.
2008-03-28 06:34:03 +00:00
Martin v. Löwis 85a896902c Merged revisions 61825-61989 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r61899 | collin.winter | 2008-03-25 17:53:41 +0100 (Di, 25 Mär 2008) | 1 line

  Add a missing explicit fixer to test_all_fixers.
........
  r61983 | collin.winter | 2008-03-28 03:19:46 +0100 (Fr, 28 Mär 2008) | 2 lines

  Fix http://bugs.python.org/issue2453: support empty excepts in fix_except.
........
2008-03-28 05:27:44 +00:00
Martin v. Löwis 53dbcd33a9 Run 2to3 tests. 2008-03-28 05:26:10 +00:00
Martin v. Löwis fac4f095c1 Disable test that depends on #2412 being fixed. 2008-03-28 05:25:36 +00:00
Jeffrey Yasskin 36550bdde9 Print more information the next time test_socket throws the wrong exception. 2008-03-28 04:53:10 +00:00
Neal Norwitz 023cd00ccc Allow use of other ports so the test can pass if 9091 is in use 2008-03-28 04:41:34 +00:00
Jeffrey Yasskin 8b9091fba0 Kill a race in test_threading in which the exception info in a thread finishing
up after it was joined had a traceback pointing to that thread's (deleted)
target attribute, while the test was trying to check that the target was
destroyed. Big thanks to Antoine Pitrou for diagnosing the race and pointing
out sys.exc_clear() to kill the exception early. This fixes issue 2496.
2008-03-28 04:11:18 +00:00
Amaury Forgeot d'Arc 7db15fe9d9 test_future3.py is a regular test file, and should be part of the test suite 2008-03-28 00:21:34 +00:00
Amaury Forgeot d'Arc da0c025a43 Issue2495: tokenize.untokenize did not insert space between two consecutive string literals:
"" "" => """", which is invalid code.

Will backport
2008-03-27 23:23:54 +00:00
Georg Brandl 853e44ca8c The bug for which there was a test in outstanding_bugs.py was agreed not to be a bug. 2008-03-27 13:34:59 +00:00
Georg Brandl deaf2cafbd #2248: return result of QUIT from quit(). 2008-03-27 13:27:31 +00:00
Christian Heimes 6c052fd523 Fixed tokenize tests
The tokenize module doesn't understand __future__.unicode_literals yet
2008-03-27 11:46:37 +00:00
Eric Smith 23a48ad101 Added test cases for single quoted strings, both forms of triple quotes,
and some string concatenations.
Removed unneeded __future__ print_function import.
2008-03-27 09:42:35 +00:00
Neal Norwitz 311d071541 Fix test_compiler after adding unicode_literals 2008-03-27 05:02:57 +00:00
Christian Heimes 3784c6b1af Use the new unicode literals for the io module
use basestring instead of str in Python 2.x
2008-03-26 23:13:59 +00:00
Christian Heimes fa50bad957 I forgot to svn add the future test 2008-03-26 22:55:31 +00:00
Christian Heimes 3c60833e1e Patch #2477: Added from __future__ import unicode_literals
The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
2008-03-26 22:01:37 +00:00
Christian Heimes 1a6387e683 Merged revisions 61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray

........
  r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line

  Copied files from py3k w/o modifications
........
  r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines

  Take One
  * Added initialization code, warnings, flags etc. to the appropriate places
  * Added new buffer interface to string type
  * Modified tests
  * Modified Makefile.pre.in to compile the new files
  * Added bytesobject.c to Python.h
........
  r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines

  Disabled bytearray.extend for now since it causes an infinite recursion
  Fixed serveral unit tests
........
  r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines

  Added PyBytes support to several places:
  str + bytearray
  ord(bytearray)
  bytearray(str, encoding)
........
  r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line

  Fixed more unit tests related to type('') is not unicode
........
  r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines

  Fixed more unit tests
  Fixed bytearray.extend
........
  r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line

  Implemented old buffer interface for bytearray
........
  r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line

  Added backport of the io module
........
  r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line

  Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte
........
  r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines

  Fixed more tests
  Fixed bytearray() comparsion with unicode()
  Fixed iterator assignment of bytearray
........
  r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines

  str(bytesarray()) now returns the bytes and not the representation of the bytearray object
  Enabled and fixed more unit tests
........
  r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines

  Clear error PyNumber_AsSsize_t() fails
  Use CHARMASK for ob_svall access
  disabled a test with memoryview again
........
  r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line

  Untested updates to the PCBuild directory
........
  r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line

  The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed.
........
  r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines

  Disabled last failing test
  I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out.
........
  r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line

  Re-enabled bytes warning code
........
  r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line

  Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass.
........
  r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line

  Re-enabled bytearray subclassing - all tests are passing.
........
2008-03-26 12:49:49 +00:00
Benjamin Peterson 13be2cf284 Added help options to PDB 2008-03-26 11:57:47 +00:00
Jerry Seutter fc7b3e3aa2 Changed test so it no longer runs as a side effect of importing. 2008-03-26 05:58:14 +00:00
Jerry Seutter 9f7af8d4da Changed test so it no longer runs as a side effect of importing. 2008-03-26 05:32:51 +00:00
Neal Norwitz 22b3e3aff8 Ensure that the mailbox is closed to prevent problems on Windows with removing
an open file.  This doesn't seem to be a problem in 2.6, but that appears
to be somewhat accidental (specific to reference counting).  When this
gets merged to 3.0, it will make the 3.0 code simpler.
2008-03-26 05:19:41 +00:00
Jerry Seutter 14f0bc7900 Changed test so it no longer runs as a side effect of importing. 2008-03-26 05:03:03 +00:00
Neal Norwitz 85fc3c1f1c Try to get this test to be less flaky. It was failing sometimes because
the connect would succeed before the timeout occurred.  Try using an
address and port that hopefully doesn't exist to ensure we get no response.
If this doesn't work, we can use a public address close to python.org
and hopefully that address never gets taken.
2008-03-26 04:55:51 +00:00
Mark Dickinson 8e85ffa4b2 Issue #2482: Make sure that the coefficient of a Decimal
instance is always stored as a str instance, even
when that Decimal has been created from a unicode string.
2008-03-25 18:47:59 +00:00
Mark Dickinson 3b24ccbe7e Issue #2478: Decimal(sqrt(0)) failed when the decimal context
was not explicitly supplied.
2008-03-25 14:33:23 +00:00
Georg Brandl d5b635f196 Make Py3k warnings consistent w.r.t. punctuation; also respect the
EOL 80 limit and supply more alternatives in warning messages.
2008-03-25 08:29:14 +00:00
Georg Brandl 80055f6295 #2355: py3k warning for buffer(). 2008-03-25 07:56:27 +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 40f5e4c5a2 Fix a bunch of UnboundLocalErrors when the tests fail. 2008-03-25 04:17:38 +00:00
Martin v. Löwis aef18b1c67 Patch #2240: Implement signal.setitimer and signal.getitimer. 2008-03-24 13:31:16 +00:00
Raymond Hettinger b72233ce63 Issue 2460: Make Ellipsis objects copyable. 2008-03-24 08:17:39 +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 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 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
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
Neal Norwitz acdb6fb2a5 Try to prevent the alarm going off early in tearDown 2008-03-23 06:16:04 +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 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