Commit Graph

13453 Commits

Author SHA1 Message Date
Benjamin Peterson f5c38dadf6 bring test_pydoc up to my high standards (now that I have them) 2008-05-18 20:48:07 +00:00
Ronald Oussoren 099646f29a MacOSX: ctypes annotation in implementation of getproxies_macosx_sysconf
getproxies_macosx_sysconf uses ctypes to call SystemConfiguration APIs. This
checkin adds ctypes annotation to specify the right argument types for the
API's that are used.

This is needed to be able to use urllib on a 64-bit system, without
annotations you'd get a hard crash.
2008-05-18 20:09:54 +00:00
Georg Brandl 8632cc2573 GHOP #121: improve test_pydoc, by Benjamin Peterson. 2008-05-18 16:32:48 +00:00
Georg Brandl 88e2acf038 GHOP #257: test distutils' build_ext command, written by Josip Dzolonga. 2008-05-18 11:52:36 +00:00
Georg Brandl 0bb0299ad8 Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
2008-05-18 10:39:26 +00:00
Georg Brandl f899dfa1d1 GHOP #134, #171, #137: unit tests for the three HTTPServer modules. 2008-05-18 09:12:20 +00:00
Georg Brandl a9916b55de #2353: raise Py3k warning in file.xreadlines(). 2008-05-17 22:11:54 +00:00
Fred Drake cb51d84214 update references and documentation for modules in the new html package
(http://bugs.python.org/issue2882)
2008-05-17 21:14:05 +00:00
Fred Drake 91ae250273 rename HTMLParser to html.parser, htmlentitydefs to html.entities
(http://bugs.python.org/issue2882)
2008-05-17 20:30:04 +00:00
Benjamin Peterson c6d64ec83f revert 63425 over Guido's Febuary message about this, that I missed 2008-05-17 20:09:42 +00:00
Benjamin Peterson d7943cb71d fix spelling 2008-05-17 19:51:10 +00:00
Benjamin Peterson 79a922d6df add Py3k warnings to oct and hex. backport hex behavior (because it's not different) 2008-05-17 19:21:20 +00:00
Georg Brandl 9098a0d100 Don't export a name "tkinter" from the "tkinter" package.
Else people doing "from tkinter import *" will get a nasty surprise.
2008-05-17 18:17:45 +00:00
Georg Brandl f4a942c980 Really move the imports to the top this time. :) 2008-05-17 18:15:24 +00:00
Georg Brandl 28fdfa9839 #961805: fix Edit.text_modified(). 2008-05-17 17:57:01 +00:00
Georg Brandl a9c205dd46 Move imports to file top. 2008-05-17 15:30:35 +00:00
Georg Brandl 8291f8efae Tkinter: make stub modules. 2008-05-17 15:21:58 +00:00
Georg Brandl 7e6b33f00a Tkinter rename: merge tkSimpleDialog and tkFileDialog into simpledialog and filedialog. 2008-05-17 15:07:03 +00:00
Gregory P. Smith af8a68733f fix issue2381: test_subprocess fails if your sys.executable is on a
path with a space in it.
2008-05-17 07:17:34 +00:00
Gregory P. Smith 664782e1c8 issue2858: Fix potential memory corruption when bsddb.db.DBEnv.lock_get
and other bsddb.db object constructors raised an exception.
Debugging & patch by Neal Norowitz.
2008-05-17 06:12:02 +00:00
Raymond Hettinger ce956842e2 Fix-up docstring 2008-05-17 04:13:36 +00:00
Thomas Heller ee130b72f8 Very simple test for ctypes.util.find_library on Windows. 2008-05-16 20:19:07 +00:00
Thomas Heller 95ba13fa85 Issue 1793: Add ctypes.util.find_msvcrt() function (on Windows). 2008-05-16 20:06:31 +00:00
Alexandre Vassalotti 3c4971c40e Added Python 3.0 warning to cPickle. 2008-05-16 19:14:31 +00:00
Alexandre Vassalotti ea0b22a167 Patch by Quentin Gallet-Gilles: Renaming leftovers for 2.6.
This fixes the omissions of configparser, copyreg, queue and
socketserver renaming.
2008-05-16 18:03:52 +00:00
Georg Brandl ad9afeb8f0 Tkinter rename, step 2: fix imports and add stub modules. 2008-05-16 15:48:15 +00:00
Georg Brandl bbc57d73a0 Step 1 of Tkinter renaming: move lib-tk modules into a new "tkinter" package. 2008-05-16 14:24:45 +00:00
Georg Brandl ecf9091f59 Don't allow keyword arguments to reversed(). 2008-05-16 13:24:29 +00:00
Georg Brandl 5ffad6646e Make generator repr consistent with function and code object repr. 2008-05-16 09:34:48 +00:00
Alexandre Vassalotti a8eaf8faf3 Rename the test file of reprlib. 2008-05-16 07:14:08 +00:00
Alexandre Vassalotti 50a1acb2ab Changed references to the reprlib module to use its new name. 2008-05-16 06:58:49 +00:00
Alexandre Vassalotti 95d97c7390 Renamed the repr module to reprlib.
Added stub module for repr.
2008-05-16 06:37:57 +00:00
Benjamin Peterson 5915a4dcfe make test_platform a bit more assertive (We'll see what the buildbots say.) 2008-05-16 02:24:49 +00:00
Alexandre Vassalotti eb8cef2664 Fixed import of configparser in the distutils module.
If configparser is unavailable, try to import configparser using its
old name. This is required for backward-compatibility with older
Python versions.
2008-05-16 02:06:59 +00:00
Brett Cannon fa40bbf625 Deprecated statvfs for removal in 3.0. 2008-05-16 00:50:02 +00:00
Brett Cannon 90f2cb422f Remove the last usage of statvfs in the stdlib. 2008-05-16 00:37:42 +00:00
Brett Cannon 2224817cdf Deprecate sunaudiodev/SUNAUDIODEV for removal in 3.0. 2008-05-16 00:10:24 +00:00
Alexandre Vassalotti f7f439b6f1 Fixed typo in a doctest of test_genexps. 2008-05-15 20:31:42 +00:00
Alexandre Vassalotti 3b46fcfb38 Revert r63323: Use lowercase version of module name.
The distutils module should continue to use the old ConfigParser name,
for backward-compatibility.
2008-05-15 20:30:56 +00:00
Andrew M. Kuchling a5c3878b32 Import class from distutils.cmd, not .core, to avoid circular import 2008-05-15 20:07:39 +00:00
Andrew M. Kuchling e00aeccf2e Use lowercase version of module name 2008-05-15 20:06:51 +00:00
Georg Brandl c91210c06b #2863: add gen.__name__ and add this name to generator repr(). 2008-05-15 15:08:32 +00:00
Gregory P. Smith 00ca01e7c3 disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it.  (I verified that by testing this test code on
an older Modules/_bsddb.c)
2008-05-15 04:56:18 +00:00
Brett Cannon 74a596c068 Deprecate WAIT for removal in 3.0. 2008-05-15 04:17:35 +00:00
Brett Cannon f56b6aeb06 Deprecated torgb for removal in 3.0. 2008-05-15 04:15:25 +00:00
Brett Cannon 518c5da219 Deprecate SV for removal in 3.0. 2008-05-15 04:13:19 +00:00
Brett Cannon cd2de08257 Deprecate readcd for removal in 3.0. 2008-05-15 03:51:21 +00:00
Brett Cannon 11ae6e7151 Deprecated panelparser for removal in 3.0. 2008-05-15 03:49:00 +00:00
Brett Cannon 7e37586c50 The panel module for IRIX has been deprecated for removal in 3.0. 2008-05-15 03:46:27 +00:00
Brett Cannon 89f5d9cc81 Deprecate jpeg for IRIX for removal in 3.0. 2008-05-15 03:44:00 +00:00
Brett Cannon d8c41ecc17 Deprecate IOCTL from IRIX for removal in 3.0. 2008-05-15 03:41:55 +00:00
Brett Cannon 6328b297dc Deprecate IN from IRIX for removal in 3.0. 2008-05-15 03:36:13 +00:00
Brett Cannon 4652537ba4 Deprecate imgfile for removal in 3.0. 2008-05-15 03:32:11 +00:00
Brett Cannon 707e384a7a Deprecate GLWS from IRIX for removal in 3.0. 2008-05-15 03:29:18 +00:00
Brett Cannon 82bd94e651 Deprecate GET from IRIX for removal in 3.0. 2008-05-15 03:27:12 +00:00
Brett Cannon 75ba465099 Deprecated 'fm' for removal in 3.0. 2008-05-15 03:23:17 +00:00
Brett Cannon 178582e2a4 FL, flp, and fl from IRIX have been deprecated for removal in 3.0. 2008-05-15 03:20:36 +00:00
Brett Cannon 72ccc40db5 FILE from IRIX has been deprecated for removal in 3.0. 2008-05-15 03:17:24 +00:00
Brett Cannon 2773b6f1c9 Deprecate ERRNO for removal in 3.0. 2008-05-15 03:14:57 +00:00
Brett Cannon 044616aa24 Deprecate DEVICE, GL, gl, and the related modules cgen and cgensupport for removal in 3.0. 2008-05-15 02:33:55 +00:00
Alexandre Vassalotti 7663f9e4ff Revert distutils changes done in r63248.
As explained by Marc-Andre Lemburg, distutils needs to stay
backward-compatible. Therefore, it should use the old ConfigParser
module name.
2008-05-15 00:33:57 +00:00
Alexandre Vassalotti e2514c6f10 Updated import statements to use the new `configparser` module name.
Updated the documentation to use the new name.
Revert addition of the stub entry for the old name.

Georg, I am reverting your changes since this commit should propagate
to py3k.
2008-05-14 22:44:22 +00:00
Alexandre Vassalotti e3a23c0734 Renamed the ConfigParser module to 'configparser'. 2008-05-14 22:07:07 +00:00
Alexandre Vassalotti 1b9df6862a Moved copy_reg stub module to lib-old/.
Stub modules will be easier to track (and remove) if they are all kept
in lib-old/, instead of sprinkling them throughout the library.
2008-05-14 21:52:37 +00:00
Brett Cannon 650f5161f4 Deprecate CL, CL_old, and cl for 3.0. 2008-05-14 21:12:12 +00:00
Brett Cannon 54c77aa459 Deprecate the cdplayer module for IRIX for 3.0. 2008-05-14 21:08:41 +00:00
Brett Cannon 9eebe49d07 The cddb module for IRIX has been deprecated for 3.0. 2008-05-14 20:34:22 +00:00
Brett Cannon ddf949f194 The CD and cd modules for IRIX are deprecated for 3.0. 2008-05-14 20:31:38 +00:00
Georg Brandl 885982283e Fix another "refleak" by clearing the filters after test. 2008-05-14 07:18:22 +00:00
Neal Norwitz 40388cc330 Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
2008-05-14 06:47:56 +00:00
Gregory P. Smith ee365b9f92 Enable the updated Lib/bsddb/test suite to run. 2008-05-14 04:27:01 +00:00
Brett Cannon ea785fb0cf Rewrap some lines in test_py3kwarn. 2008-05-14 01:09:40 +00:00
Brett Cannon 34721d5683 Deprecate al/AL for removal in 3.0. 2008-05-14 01:08:21 +00:00
Jesus Cea 18eb1fa2dd Testsuite for bsddb module, version 4.6.4 2008-05-13 20:57:59 +00:00
Georg Brandl 913835763a #2831: add start argument to enumerate(). Patch by Scott Dial and me. 2008-05-13 19:04:54 +00:00
Benjamin Peterson bbb093751c use .format and fix a bug 2008-05-13 00:09:46 +00:00
Benjamin Peterson ab1fb9f728 Make error messages more helpful 2008-05-12 22:26:05 +00:00
Amaury Forgeot d'Arc e1b93f2855 Adapt test_pyclbr to the new version of urllib.py:
The new mac-specific functions must be ignored.
2008-05-12 22:21:39 +00:00
Benjamin Peterson 236819310d Add warnings to and deprecated all those Mac modules 2008-05-12 21:42:13 +00:00
Georg Brandl 1b4758d276 #2767: don't clear globs in run() call, since they could be needed in tearDown,
which clears them at the end.
2008-05-12 17:04:10 +00:00
Georg Brandl 45141d0057 #2766: remove code without effect. 2008-05-12 17:01:58 +00:00
Georg Brandl 23da6e6545 #1713041: fix pprint's handling of maximum depth. 2008-05-12 16:26:52 +00:00
Ronald Oussoren 9dd6b1db5b MacOSX: remove dependency on Carbon package for urllib
This patch removes the dependency on the Carbon package from urllib.
The mac-specific code for getting proxy configuration is now writting in
Python using ctypes and uses the SystemConfiguration framework instead of
InternetConfig. Also provides a mac-specific implementation of proxy_bypass.
2008-05-12 11:31:05 +00:00
Ronald Oussoren 81af68ee61 Remove references to platform 'mac'
The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port,
which is no longer supported (as of Python 2.4 IIRC).
2008-05-12 11:24:33 +00:00
Brett Cannon ac861b5a17 Deprecate the sv module as per PEP 4. 2008-05-12 03:45:59 +00:00
Brett Cannon 43e5ef49b1 Deprecate the multifile module as per PEP 4. 2008-05-12 03:19:20 +00:00
Alexandre Vassalotti d192c925ac Updated all import statements to use the new socketserver module name.
Renamed socketserver module in its own documentation.
Renamed documentation references.
2008-05-12 02:11:22 +00:00
Alexandre Vassalotti fb9ce65a91 Renamed SocketServer to 'socketserver'.
Deprecated old name.
2008-05-12 01:37:10 +00:00
Benjamin Peterson b9030f4f0d #2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate 2008-05-12 00:41:23 +00:00
Brett Cannon 42bfa90f02 Depreate imageop for removal in 3.0. 2008-05-12 00:08:34 +00:00
Alexandre Vassalotti 1fcaa77ac5 Revert commit r63086. 2008-05-11 23:12:38 +00:00
Alexandre Vassalotti f4e83dedda Moved the Queue module stub in lib-old. 2008-05-11 23:04:27 +00:00
Georg Brandl 275360eaa5 #2535: remove duplicated method. 2008-05-11 21:34:10 +00:00
Georg Brandl 627a666db0 - #2250: Exceptions raised during evaluation of names in rlcompleter's
``Completer.complete()`` method are now caught and ignored.
2008-05-11 21:03:42 +00:00
Alexandre Vassalotti 8940ecd39d Added stub for the PixMapWrapper module to be renamed in 3.0.
Modified TestStdlibRenames to support platform specific renames.
Added test for PixMapWrapper rename warning.
Added note to documentation about PixMapWrapper rename.
2008-05-11 20:30:43 +00:00
Andrew M. Kuchling 5128fb9715 Try setting HOME env.var to fix test on Win32 2008-05-11 20:08:33 +00:00
Alexandre Vassalotti 73812bf2a6 Added test for Queue rename warning.
Added note to documentation about Queue rename.
2008-05-11 20:04:03 +00:00
Eric Smith cf537ff39e Addresses issue 2802: 'n' formatting for integers.
Adds 'n' as a format specifier for integers, to mirror the same
specifier which is already available for floats.  'n' is the same as
'd', but inserts the current locale-specific thousands grouping.

I added this as a stringlib function, but it's only used by str type,
not unicode.  This is because of an implementation detail in
unicode.format(), which does its own str->unicode conversion.  But the
unicode version will be needed in 3.0, and it may be needed by other
code eventually in 2.6 (maybe decimal?), so I left it as a stringlib
implementation.  As long as the unicode version isn't instantiated,
there's no overhead for this.
2008-05-11 19:52:48 +00:00
Alexandre Vassalotti 30ece44f2e Added stub for the Queue module to be renamed in 3.0.
Use the 3.0 module name to avoid spurious warnings.
2008-05-11 19:39:48 +00:00
Andrew M. Kuchling ca3ccd15ff Add message to test assertion 2008-05-11 19:15:52 +00:00
Georg Brandl ea823a866c #2803: fix wrong invocation of heappush in seldom-reached code.
Thanks to Matt Harden.
2008-05-11 15:20:16 +00:00
Georg Brandl d063240d91 #2787: Flush stdout after writing test name, helpful when running
hanging or long-running tests. Patch by Adam Olsen.
2008-05-11 15:17:41 +00:00
Georg Brandl b52a74b517 #2816: clarify error messages for EOF while scanning strings. 2008-05-11 15:07:39 +00:00
Georg Brandl 6a57c08dc8 #1326: document and test zipimporter.archive and zipimporter.prefix. 2008-05-11 15:05:13 +00:00
Georg Brandl 9020ff88e6 Add some sentence endings. 2008-05-11 14:17:13 +00:00
Benjamin Peterson 98353941ea Add the "until" command to pdb 2008-05-11 14:13:25 +00:00
Andrew M. Kuchling aac5c8669f #1858: re-apply patch for this, adding the missing files 2008-05-11 14:00:00 +00:00
Andrew M. Kuchling 6c02916dfb #1792: Improve performance of marshal.dumps() on large objects by increasing
the size of the buffer more quickly.
2008-05-11 13:33:56 +00:00
Georg Brandl 6f95ae55b1 #2659: add ``break_on_hyphens`` to TextWrapper. 2008-05-11 10:42:28 +00:00
Alexandre Vassalotti 25ad76c91d Added test for copy_reg rename.
Added note to documentation about copy_reg rename.
2008-05-11 09:01:51 +00:00
Alexandre Vassalotti 9510e4a9f8 Added module stub for copy_reg renaming in 3.0.
Renamed copy_reg to copyreg in the standard library, to avoid
spurious warnings and ease later merging to py3k branch. Public
documentation remains intact.
2008-05-11 08:25:28 +00:00
Alexandre Vassalotti f602c71b07 Removed a dead line of code. 2008-05-11 07:10:25 +00:00
Alexandre Vassalotti 445ff35d5c Fixed typo in a comment of test_support.CleanImport. 2008-05-11 07:08:12 +00:00
Alexandre Vassalotti eb83f70586 Added test framework for handling module renames.
Factored the import guard in test_py3kwarn.TestStdlibRemovals into
a context manager, namely test_support.CleanImport.
2008-05-11 07:06:04 +00:00
Brett Cannon 2a86913864 Deprecated the mhlib module for removal in 3.0. 2008-05-11 03:01:47 +00:00
Brett Cannon df0a717037 The linuxaudidev module has been deprecated for removal in Python 3.0. 2008-05-11 00:50:51 +00:00
Brett Cannon 27508d4eb9 Deprecate ihooks for removal in 3.0. 2008-05-10 22:45:07 +00:00
Andrew M. Kuchling 2bca212239 #1858: add distutils.config module 2008-05-10 22:12:38 +00:00
Brett Cannon fe5985188d Deprecate the fpformat module for removal in 3.0. 2008-05-10 22:11:45 +00:00
Brett Cannon 7f874fce63 Deprecate the dl module for removal in 3.0. 2008-05-10 21:20:19 +00:00
Brett Cannon 0aa6e1b8fb Deprecate the dircache module for 3.0. 2008-05-10 21:12:57 +00:00
Brett Cannon 10f5db6424 Revert r62998 as it broke the build (seems distutils.config is missing). 2008-05-10 20:52:01 +00:00
Alexandre Vassalotti 844f757aae Cleaned up io._BytesIO.write().
I am amazed that the old code, for inserting null-bytes, actually
worked. Who wrote that thing? Oh, it is me... doh.
2008-05-10 19:59:16 +00:00
Andrew M. Kuchling cd8001c8ed #1858 from Tarek Ziade:
Allow multiple repositories in .pypirc; see http://wiki.python.org/moin/EnhancedPyPI
for discussion.

The patch is slightly revised from Tarek's last patch: I've simplified
the PyPIRCCommand.finalize_options() method to not look at sys.argv.
Tests still pass.
2008-05-10 19:51:55 +00:00
Andrew M. Kuchling 5217d5d678 Docstring typo 2008-05-10 17:36:24 +00:00
Brett Cannon ddf7a4214e Make sure warnings are not suppressed when testing for the raised
DeprecationWarning.
2008-05-10 03:16:38 +00:00
Brett Cannon d5a0985265 The Canvas module has been deprecated for removal in 3.0. 2008-05-10 03:14:32 +00:00
Brett Cannon 756bc0b722 Add a test for the deprecation of the compiler package. 2008-05-10 03:09:35 +00:00
Benjamin Peterson 5f9050a1c6 Add the examples in the json module docstring as a doctest 2008-05-10 03:08:17 +00:00
Brett Cannon 6192df10b6 Deprecate the compiler package for removal in 3.0. 2008-05-10 02:58:26 +00:00
Brett Cannon af87804831 Also ignore package deprecations. 2008-05-10 02:57:03 +00:00
Brett Cannon edb628f241 Suppress deprecations for packages as well when using
test.test_support.import_module().
2008-05-10 02:54:52 +00:00
Brett Cannon 768d44f54d Deprecate the bsddb185 module for removal in 3.0. 2008-05-10 02:47:54 +00:00
Brett Cannon 4c1f881f13 Deprecate Bastion and rexec for 3.0. 2008-05-10 02:27:04 +00:00
Brett Cannon 9ac3974de8 Deprecate the pure module for 3.0. 2008-05-09 22:51:58 +00:00
Alexandre Vassalotti 1aed624f7c Backport fast alternate io.BytesIO implementation.
Merged r62778, r62779, r62802, r62806, r62807, r62808, r62809, r62844,
r62846, r62952, r62956.
2008-05-09 21:49:43 +00:00
Mark Dickinson f8476c1573 Issue #2487. math.ldexp(x, n) raised OverflowError when n was large and
negative; fix to return an (appropriately signed) zero instead.
2008-05-09 17:54:23 +00:00
Christian Heimes 17433d206c Add --user option to build_ext 2008-05-09 12:19:09 +00:00
Brett Cannon fa24d9a71c Deprecate the toaiff module for removal in 3.0. 2008-05-09 05:32:42 +00:00
Brett Cannon 3c75914434 Deprecate test.testall for removal in 3.0. 2008-05-09 05:25:37 +00:00
Brett Cannon d7265d6483 Deprecate the new module for removal in 3.0. 2008-05-09 05:18:40 +00:00
Benjamin Peterson 0893a0a961 Add Py3k warnings to os.path.walk 2008-05-09 00:27:01 +00:00
Benjamin Peterson 9ec4aa01f9 Replace instances of os.path.walk with os.walk 2008-05-08 22:09:54 +00:00
Brett Cannon e3b1940eb9 Deprecate the user module for removal in 3.0. 2008-05-08 20:36:09 +00:00
Brett Cannon be1501b976 Fix sys.flags to properly expose bytes_warning.
Closes issue #2790.
2008-05-08 20:23:06 +00:00
Brett Cannon 5d023c3afa Fix a bug introduced by the addition of the 'record' argument to
test.test_support.catch_warning() where showwarning() was not being set
properly.
2008-05-08 20:20:24 +00:00
Brett Cannon 6071cc8fb0 Deprecate stringold for removal in 3.0. 2008-05-08 19:52:45 +00:00
Brett Cannon bfb997d6a5 Make test.test_support.catch_warning() take an argument specifying if any
triggered warnings should be captured. This allows the context manager to be
used to just prevent the internal state of the 'warnings' framework and thus
allow triggered warnings to be displayed.
2008-05-08 19:50:51 +00:00
Brett Cannon 9d44182427 The mutex module has been deprecated for removal in 3.0. 2008-05-08 19:26:08 +00:00
Brett Cannon 80bb9d92e3 Deprecate the imputil module for removal in 3.0. 2008-05-08 18:15:14 +00:00
Barry Warsaw 6cc7940e10 Bump to 2.6a3 2008-05-08 13:16:19 +00:00
Ronald Oussoren c27b8b88e3 Fix for issue 1770190: platform.mac_ver() now returns the right
version on OSX 10.4.10
2008-05-08 10:34:39 +00:00
Raymond Hettinger cf98f03a62 The __all__ variable forgot to expose the gcd() function. 2008-05-08 04:36:12 +00:00
Benjamin Peterson 2e6407d813 Practice EAFP, and revert 62787 2008-05-07 23:11:54 +00:00
Christian Heimes 33e4a98a3e Replace more float hacks with correct math functions 2008-05-07 22:54:17 +00:00
Christian Heimes c2ca6db143 Disabled some unit tests for the upcoming release. See #2777 2008-05-06 23:42:58 +00:00
Brett Cannon e5d2cbaeaf Deprecate the audiodev module for 3.0. 2008-05-06 23:23:34 +00:00
Brett Cannon 79618239d1 When testing a module's __all__, we really don't care if it is deprecated. 2008-05-06 23:22:02 +00:00
Christian Heimes af748c3ab8 Implemented PEP 370 2008-05-06 22:41:46 +00:00
Benjamin Peterson 323c40d48c Make the Python implementation of warnings compatible with the C implementation regarding non-callable showwarning 2008-05-06 22:31:52 +00:00
Benjamin Peterson d295032910 Fix logic error in Python/_warnings.c and add a test to verify 2008-05-06 22:18:11 +00:00
Christian Heimes c8a0d2f368 Intern static string
Use float constructors instead of magic code for float constants
2008-05-06 16:18:41 +00:00
Gregory P. Smith 8e4997390c fix issue2707 - os.walk docstring example correctness typo. 2008-05-06 07:05:18 +00:00
Brett Cannon e3dcb01bfc Fix a bug in the handling of the stacklevel argument in warnings.warn() where
the stack was being unwound by two levels instead of one each time.
2008-05-06 04:37:31 +00:00
Benjamin Peterson 0b7f77847a PEP 8 nits in json package 2008-05-06 02:51:10 +00:00
Gregory P. Smith 24237ea8a1 Fix a bug introduced in r62627. see issue2760 and issue2632.
An assertion in readline() would fail as data was already in the
internal buffer even though the socket was in unbuffered read mode.
That case is now handled.  More importantly, read() has been fixed to
not over-recv() and leave newly recv()d data in the _fileobject buffer.

The max() vs min() issue in read() is now gone.  Neither was correct.
On bounded reads, always ask recv() for the exact amount of data we
still need.

Candidate for backporting to release25-maint along with r62627.
2008-05-05 21:53:45 +00:00
Brett Cannon 4b964f9c90 Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Ippolito.

Closes issue #2750.
2008-05-05 20:21:38 +00:00
Martin v. Löwis 5f2e0e5ccb Revert bogus checkin in r62724 to that file. 2008-05-05 17:54:01 +00:00
Martin v. Löwis c3ad68c88a Fix Unicode filename test. 2008-05-05 17:47:06 +00:00
Martin v. Löwis 471617d6d3 Issue #1734346: Support Unicode file names for zipfiles. 2008-05-05 17:16:58 +00:00
Brett Cannon 9c19bc6247 Remove the use of 'inspect' from 'warnings' for detected deprecated use of the
showwarning API. Turns out 'inspect' uses 'operator' which is an extension
module. That's a problem when it has not been built yet by setup.py.
2008-05-05 16:57:38 +00:00
Brett Cannon 8a232cc385 Add a DeprecationWarning for when warnings.showwarning() is set to a function
that lacks support for the new 'line' argument.
2008-05-05 05:32:07 +00:00
Benjamin Peterson 9ae080ee5a Remove method signatures from the docstrings of io.py 2008-05-04 22:39:33 +00:00
Georg Brandl 8d66dcd0f4 #2695: Do case-insensitive check for algorithms. 2008-05-04 21:40:44 +00:00
Gerhard Häring e11c9b3dfd Implemented feature request 2157: Converter names are cut off at '('
characters. This avoids the common case of something like 'NUMBER(10)' not
being parsed as 'NUMBER', like expected. Also corrected the docs about
converter names being case-sensitive. They aren't any longer.
2008-05-04 13:42:44 +00:00
Gerhard Häring 5a366c3b8b Applied sqliterow-richcmp.diff patch from Thomas Heller in Issue2152. The
sqlite3.Row type is now correctly hashable.
2008-05-04 13:15:12 +00:00
Mark Dickinson 71f3b85497 Make sure that Context traps and flags dictionaries have values 0 and 1
(as documented) rather than True and False.
2008-05-04 02:25:46 +00:00
Mark Dickinson 8aca9d032e Some very minor changes to decimal.py in Python 2.6, aimed
at reducing the size of the diff between the 2.x decimal.py
and 3.x decimal.py and thereby making future merges easier:

- replace one instnace of an old-style raise statement
- define __div__ in terms of __truediv__ instead of the
  other way around
- make wording match on an exception message
2008-05-04 02:05:06 +00:00
Benjamin Peterson 979395b7a8 Moved testing of builtin types out of test_builtin and into type specific modules 2008-05-03 21:35:18 +00:00
Mark Dickinson 1840c1abca Backport Raymond's changes in r60508 to Python 2.6.
'Context flags get set, not incremented'
2008-05-03 18:23:14 +00:00
Amaury Forgeot d'Arc 7684f85297 In test_io, StatefulIncrementalDecoderTest was not part of the test suite.
And of course, the test failed:
a bytearray was used without reason in io.TextIOWrapper.tell().

The difference is that iterating over bytes (i.e. str in python2.6) returns 1-char bytes,
whereas bytearrays yield integers.
This code should still work with python3.0
2008-05-03 12:21:13 +00:00
Brett Cannon 64a4bbeb25 Fix the C implementation of 'warnings' to infer the filename of the module that
raised an exception properly when __file__ is not set, __name__ == '__main__',
and sys.argv[0] is a false value.

Closes issue2743.
2008-05-03 03:19:39 +00:00
Ronald Oussoren 26f545c662 Fix for issue #2520 (cannot import macerrors) 2008-05-02 21:54:56 +00:00
Ronald Oussoren f2ef92cee7 Fix for #1905: PythonLauncher not working correctly on OSX 10.5/Leopard
This fixes both Python Launchar and the terminalcommand module.
2008-05-02 21:42:35 +00:00
Martin v. Löwis 6780a9dd9f Merged revisions 62263-62646 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r62470 | david.wolever | 2008-04-24 02:11:07 +0200 (Do, 24 Apr 2008) | 3 lines

  Fixed up and applied the patch for #2431 -- speeding up 2to3 with a lookup table.
........
  r62646 | martin.v.loewis | 2008-05-02 23:29:27 +0200 (Fr, 02 Mai 2008) | 2 lines

  Fix whitespace.
........
2008-05-02 21:30:20 +00:00
Facundo Batista ee340e501d Fixed some test structures. Thanks Mark Dickinson. 2008-05-02 17:39:00 +00:00
Mark Hammond 7c5c8e6823 #2581: Vista UAC/elevation support for bdist_wininst 2008-05-02 12:48:15 +00:00
Gregory P. Smith f8cc64017c This should fix issue2632. A long description of the two competing
problems is in the bug report (one old, one recently introduced trying
to fix the old one).  In short:

buffer data during socket._fileobject.read() and readlines() within a
cStringIO object instead of a [] of str()s returned from the recv()
call.

This prevents excessive memory use due to the size parameter being
passed to recv() being grossly larger than the actual size of the data
returned *and* prevents excessive cpu usage due to looping in python
calling recv() with a very tiny size value if min() is used as the
previous memory-use bug "fix" did.

It also documents what the socket._fileobject._rbufsize member is
actually used for.

This is a candidate for back porting to 2.5.
2008-05-02 07:26:52 +00:00
Benjamin Peterson 95287fa951 Remove some from __future__ import with_statements 2008-04-30 21:25:55 +00:00
Georg Brandl 655fc7012a #1748: use functools.wraps instead of rolling own metadata update. 2008-04-30 21:08:42 +00:00
Benjamin Peterson d8f2d0bdb3 make test_support's captured_output a bit more robust when exceptions happen 2008-04-30 21:03:58 +00:00
Georg Brandl 28e0873f1f #2719: backport next() from 3k. 2008-04-30 19:47:09 +00:00
Eric Smith 0a95063d73 Issue 2526, float.__format__ 'n' specifier does not support thousands grouping.
Implemented grouping, with tests.
Cleaned up PyOS_ascii_formatd by breaking reformatting into smaller functions.
2008-04-30 01:09:30 +00:00
Amaury Forgeot d'Arc 87da1278eb test_sundry performs minimal tests (a simple import...) on modules that are not tested otherwise.
Some of them now have tests and can be removed.
Only 70 to go...
2008-04-28 21:07:06 +00:00
Brett Cannon 8dc4303297 Rename the test_traceback_print() function to traceback_print() to prevent
test_capi from automatically calling the function.
2008-04-28 04:50:06 +00:00
Skip Montanaro b8bdbc04e7 Get rid of _test(), _main(), _debug() and _check(). Tests are no longer
needed (better set available in Lib/test/test_robotparser.py).  Clean up a
few PEP 8 nits (compound statements on a single line, whitespace around
operators).
2008-04-28 03:27:53 +00:00
Brett Cannon 141534e56f Fix a bug introduced by the warnings rewrite where tracebacks were being
improperly indented.

Closes issue #2699.
2008-04-28 03:23:50 +00:00
Skip Montanaro fe1372c7d5 Minor cleanups:
* Avoid creating unused local variables where we can.  Where we can't prefix
  the unused variables with '_'.
* Avoid shadowing builtins where it won't change the external interface of a
  function.
* Use None as default path arg to readmodule and readmodule_ex.
2008-04-28 02:57:23 +00:00
Skip Montanaro ea59a84244 A few small changes:
* The only exception we should catch when trying to import cStringIO is an
  ImportError.
* Delete the function signatures embedded in the mk*temp docstrings.
* The tempdir global variable was initialized twice.
2008-04-27 22:49:56 +00:00
Kurt B. Kaiser 83101909cb Autocompletion of filenames now support alternate separators, e.g. the
'/' char on Windows.  Patch 2061 Tal Einat.
2008-04-27 21:52:19 +00:00
Kurt B. Kaiser 9c5c0af804 Improved AutoCompleteWindow logic. Patch 2062 Tal Einat. 2008-04-27 21:38:05 +00:00
Kurt B. Kaiser 93cdae5f81 Home / Control-A toggles between left margin and end of leading white
space.  Patch 1196903 Jeff Shute.

M    idlelib/PyShell.py
M    idlelib/EditorWindow.py
M    idlelib/NEWS.txt
2008-04-27 21:07:41 +00:00
Alexandre Vassalotti ba08f072d2 Fixed URL of PEP 205 in weakref's module docstring. 2008-04-27 00:52:24 +00:00
Benjamin Peterson 14204ad982 Allow test_import to work when it is invoked directly 2008-04-25 21:43:56 +00:00
Mark Dickinson fe536f53ea Issue 2635: fix bug in the fix_sentence_endings option to textwrap.fill. 2008-04-25 16:59:09 +00:00
Thomas Heller 6ad5fbb7ea Add from_buffer and from_buffer_copy class methods to ctypes types. 2008-04-25 15:44:16 +00:00
Armin Rigo 5364e2e46f A new crasher. 2008-04-25 09:35:18 +00:00
Amaury Forgeot d'Arc 1c596d5604 Use absolute import for test package 2008-04-24 20:41:50 +00:00
Amaury Forgeot d'Arc 747720540c Add a few tests for pydoc.
This is a modified version of a patch proposed by Humberto Diogenes
in the discussion of issue1883.

I will merge manually this change into the py3k branch: the tests must be adapted.
2008-04-24 20:22:26 +00:00
Amaury Forgeot d'Arc 48ebc264f8 Disable gc when running test_trace, or we may record the __del__ of collected objects.
See http://mail.python.org/pipermail/python-checkins/2008-April/068633.html
the extra events perfectly match several calls to socket._fileobject.__del__()
2008-04-24 20:10:26 +00:00
Amaury Forgeot d'Arc 5216721a53 Issue2681: the literal 0o8 was wrongly accepted, and evaluated as float(0.0).
This happened only when 8 is the first digit.
Credits go to Lukas Meuser.
2008-04-24 18:07:05 +00:00
Amaury Forgeot d'Arc 9686585a82 Issue #2670: urllib2.build_opener() failed when two handlers
derive the same default base class.

Will backport.
2008-04-22 21:14:41 +00:00
Gregory P. Smith 19b4411181 Major improvements:
* Default to using /dev/tty for the password prompt and input before
  falling back to sys.stdin and sys.stderr.
* Use sys.stderr instead of sys.stdout.
* print the 'password may be echoed' warning to stream used to display
  the prompt rather than always sys.stderr.
* warn() with GetPassWarning when input may be echoed.
2008-04-22 08:08:41 +00:00
Amaury Forgeot d'Arc dd8d824a56 Issue 2665: On Windows, sys.stderr does not contain a valid file when running without a console.
It seems to work, but will fail at the first flush.

This causes IDLE to crash when too many warnings are printed.

Will backport.
2008-04-21 22:35:30 +00:00
Gregory P. Smith 41e3018336 If sys.stdin is not a tty, fall back to default_getpass after printing
a warning instead of failing with a termios.error.
2008-04-21 21:31:08 +00:00
Andrew M. Kuchling a5489d415e Comment typo 2008-04-21 01:45:57 +00:00
Amaury Forgeot d'Arc eac43afdc9 Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache contains
info for all processed zip files, even when they are no longer used.
2008-04-20 21:02:21 +00:00
Mark Dickinson d6d5148b44 Add test for tanh(-0.) == -0. on IEEE 754 systems 2008-04-20 20:38:48 +00:00
Mark Dickinson cec3f138d8 Yet more explicit special case handling to make
math.pow behave on alpha Tru64.  All IEEE 754
special values are now handled directly; only
the finite**finite case is handled by libm.
2008-04-20 04:13:13 +00:00
Mark Dickinson 9f99d70513 Report additional diagnostic information in
test_math, to help track down debian-alpha
buildbot failure.
2008-04-20 01:22:30 +00:00
Mark Dickinson e941d97d12 Additional tests for math.pow, and extra special-case
handling code in math.pow, in the hope of making all
tests pass on the alpha Tru64 buildbot.
2008-04-19 18:51:48 +00:00
Christian Heimes e74c8f2879 Added kill, terminate and send_signal to subprocess.Popen
The bits and pieces for the Windows side were already in place. The POSIX side is trivial (as usual) and uses os.kill().
2008-04-19 02:23:57 +00:00
Amaury Forgeot d'Arc 607bff1ebe Some tests did not pass on repeated calls (regrtest -R::)
Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
2008-04-18 23:31:33 +00:00
Christian Heimes 6f34109384 I finally got the time to update and merge Mark's and my trunk-math branch. The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math.
The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
2008-04-18 23:13:07 +00:00
Skip Montanaro b131f0468f resolve issue 2014 2008-04-18 20:35:46 +00:00
Nick Coghlan 1e88992224 Add test file missing from rev 62350 2008-04-15 10:28:14 +00:00
Nick Coghlan 106fc48336 Issue 2439: add pkgutils.get_data() as a convenience wrapper for the PEP 302 get_data() API (contributed by Paul Moore) 2008-04-15 10:25:31 +00:00
Thomas Heller 046e6a43ff Issue #2616: Implement ctypes.pointer() and ctypes.POINTER() in C for
better performance.
2008-04-14 16:10:07 +00:00
Brett Cannon c477427eba Fix spliting on colons on Windows machines with a file path by limiting the
number of splits.
2008-04-13 17:41:31 +00:00
Brett Cannon 25bb8182c6 Add an explicit check for output in a test to try to diagnose a failure on
Windows.
2008-04-13 17:09:43 +00:00
Skip Montanaro e3d3785e11 spelling 2008-04-13 03:17:30 +00:00
Brett Cannon 667bb4f236 Fix test_warnings by making the state of things more consistent for each test
when it is run.
2008-04-13 02:42:36 +00:00
Benjamin Peterson a3d19f35c4 Backport the removal of a __repr__ from 62251 2008-04-13 02:05:48 +00:00
Benjamin Peterson 7bb4d2d0fa Backported io module docs 2008-04-13 02:01:27 +00:00
Brett Cannon e974689038 Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the
parser). It could also potentially lead to a speed-up in interpreter start-up
if the C version of the code (_warnings) is imported over the use of the
Python version in key places.

Closes issue #1631171.
2008-04-12 23:44:07 +00:00
Gregory P. Smith e6c03033af socket.error inherits from IOError, it no longer needs listing in
the all_errors tuple.
2008-04-12 22:24:04 +00:00
Neal Norwitz 36a59b4a08 Remove the test file before writing it in case there is no write permission.
This might help fix some of the failures on Windows box(es).  It doesn't hurt
either way and ensure the tests are a little more self contained (ie have
less assumptions).
2008-04-10 05:46:39 +00:00
Martin v. Löwis 60a819d681 Merged revisions 62080-62262 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r62092 | collin.winter | 2008-04-01 18:27:10 +0200 (Di, 01 Apr 2008) | 1 line

  Add get_prev_sibling() to complement pytree's get_next_sibling().
........
  r62226 | collin.winter | 2008-04-08 21:07:56 +0200 (Di, 08 Apr 2008) | 1 line

  Add min() and max() to the list of special contexts that don't require adding list() calls around dict methods.
........
  r62232 | collin.winter | 2008-04-09 00:12:38 +0200 (Mi, 09 Apr 2008) | 4 lines

  Fix for http://bugs.python.org/issue2596

  This extends fix_xrange to know about the (mostly) same special contexts as fix_dict (where a special context is something that is guaranteed to fully consume the iterable), adding list() calls where appropriate. It also special-cases "x in range(y)".
........
2008-04-10 02:48:01 +00:00
Gregory P. Smith f108320055 better diagnostics 2008-04-09 23:11:56 +00:00
Georg Brandl 99bb5f3fef #2585: initialize code attribute of HTTPError. 2008-04-09 17:57:38 +00:00
Jerry Seutter 8f80a6a5f9 Changed test so it no longer runs as a side effect of importing. 2008-04-09 05:07:58 +00:00
Trent Nelson 6c4a7c6821 Fix typo with regards to self.PORT shadowing class variables with the same name. 2008-04-09 00:34:53 +00:00
Gregory P. Smith 79e42a0e08 Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
It tried to allocate negative or zero memory.  That fails.
2008-04-09 00:25:17 +00:00
Trent Nelson e41b0061dd - Issue #2550: The approach used by client/server code for obtaining ports
to listen on in network-oriented tests has been refined in an effort to
  facilitate running multiple instances of the entire regression test suite
  in parallel without issue.  test_support.bind_port() has been fixed such
  that it will always return a unique port -- which wasn't always the case
  with the previous implementation, especially if socket options had been
  set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
  new implementation of bind_port() will actually raise an exception if it
  is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
  SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
  will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
  This currently only applies to Windows.  This option prevents any other
  sockets from binding to the host/port we've bound to, thus removing the
  possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
  that occurs when a second SOCK_STREAM socket binds and accepts to a
  host/port that's already been bound by another socket.  The optional
  preferred port parameter to bind_port() has been removed.  Under no
  circumstances should tests be hard coding ports!

  test_support.find_unused_port() has also been introduced, which will pass
  a temporary socket object to bind_port() in order to obtain an unused port.
  The temporary socket object is then closed and deleted, and the port is
  returned.  This method should only be used for obtaining an unused port
  in order to pass to an external program (i.e. the -accept [port] argument
  to openssl's s_server mode) or as a parameter to a server-oriented class
  that doesn't give you direct access to the underlying socket used.

  Finally, test_support.HOST has been introduced, which should be used for
  the host argument of any relevant socket calls (i.e. bind and connect).

  The following tests were updated to following the new conventions:
    test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
    test_poplib, test_ftplib, test_telnetlib, test_socketserver,
    test_asynchat and test_socket_ssl.

  It is now possible for multiple instances of the regression test suite to
  run in parallel without issue.
2008-04-08 23:47:30 +00:00
Amaury Forgeot d'Arc 7adc776ea6 Issue 2408: remove the _types module
It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
when they can easily be obtained with python code.
These expressions even work with Jython.

I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
at least this change makes it simpler.
2008-04-08 22:07:05 +00:00
Amaury Forgeot d'Arc 24f3c5c646 Prevent an error when inspect.isabstract() is called with something else than a new-style class. 2008-04-08 21:51:57 +00:00
Amaury Forgeot d'Arc 4b798bdf8a Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
suite as a side-effect of importing the module.

- in test_capi, a thread tried to import other modules
- re.compile() imported sre_parse again on every call.
2008-04-08 21:27:42 +00:00
Mark Hammond 495cf99aaf Issue #2513: enable 64bit cross compilation on windows. 2008-04-07 01:53:39 +00:00
Gregory P. Smith aa63d0d4af Make file objects as thread safe as the underlying libc FILE* implementation.
close() will now raise an IOError if any operations on the file object
are currently in progress in other threads.

Most code was written by Antoine Pitrou (pitrou).  Additional testing,
documentation and test suite cleanup done by me (gregory.p.smith).

Fixes issue 815646 and 595601 (as well as many other bugs and
references to this problem dating back to the dawn of Python).
2008-04-06 23:11:17 +00:00
Jeffrey Yasskin ee76777846 Add enough debugging information to diagnose failures where the
HandlerBException is ignored, and fix one such problem, where it was thrown
during the __del__ method of the previous Popen object.

We may want to find a better way of printing verbose information so it's not
spammy when the test passes.
2008-04-06 23:04:28 +00:00
Thomas Wouters 2fab8f1abb Fix test_distutils to not fail when running 'make test' from a Python build
directory that is not the source directory (ie, one created using
'/path/to/source/configure'.) Leaves this test very slightly degraded in
that particular case, compared to the build-in-sourcedir case, but that case
isn't a particularly strong test either: neither test the actual path that
will be used after installing. There isn't a particularly good way to test
this, and a poor test beats a failing test.
2008-04-05 23:39:15 +00:00
Neal Norwitz 8510195ceb Prevent test_sqlite from hanging on older versions of sqlite.
The problem is that when trying to do the second insert, sqlite seems to sleep
for a very long time.  Here is the output from strace:

  read(6, "SQLite format 3\0\4\0\1\1\0@  \0\0\0\1\0\0\0\0"..., 1024) = 1024
  nanosleep({4294, 966296000},  <unfinished ...>

I don't know which version this was fixed in, but 3.2.1 definitely fails.
2008-04-05 04:26:31 +00:00
Trent Nelson 4bffe8293f Revert r62152 (Issue #2550). Being able to observe the results of all the buildbots was certainly useful. All of the platforms that have some form of BSD lineage -- FreeBSD, OS X, Solaris and Tru64 -- all pass the test. Windows and Linux, on the other hand, don't. Windows I knew about, Linux was a surprise. Knowing this, I believe a more appropriate fix will revolve around test_support.bind_socket() -- this method needs to return a port that nothing in the system has bound already. The best way to do this may just be to rely on ephemeral ports, rather than having the user specify a desired port, then fall back to four random ports, then try 0. 2008-04-04 20:04:09 +00:00
Trent Nelson b8e120c7c0 Issue 2550: extend test_socket.py to test SO_REUSEADDR semantics when bind() is called on identical (host, port) combinations in two separate sockets. This should raise an EADDRINUSE socket.error in all cases, irrespective of whether or not SO_REUSEADDR is set on the sockets. However, with Windows, when SO_REUSEADDR is set on the sockets, no error is thrown (an error is thrown when the option isn't set), which results in an extremely wedged python process whenever accept() is called on either of the bound sockets. I'm committing this test now to observe if it's only Windows that has this behaviour (via the buildbots). Note: this WILL break all Windows buildbots for now; once I've observed the results on other platforms, I'll revert, then start looking into a patch. 2008-04-04 17:26:21 +00:00
Jeffrey Yasskin e71d8124c2 Oops again. EINTR is in errno, not signal. 2008-04-04 16:48:19 +00:00
Fred Drake 449651558c stupid, stupid, stupid! 2008-04-04 11:38:51 +00:00
Fred Drake fe7056240b my previous change did what I said it should not: it changed the current
directory to the directory in which the setup.py script lived (which made
__file__ wrong)

fixed, with test that the script is run in the current directory of the caller
2008-04-04 11:31:14 +00:00
Thomas Heller 8e8ba151dd Issue #2543: Make ctypes compatible (again) with Python 2.3, 2.4, and 2.5. 2008-04-04 08:35:44 +00:00
Fred Drake 46c58c17f1 - Issue #2385: distutils.core.run_script() makes __file__ available, so the
controlled environment will more closely mirror the typical script
  environment.  This supports setup.py scripts that refer to data files.
2008-04-04 05:41:30 +00:00
Jeffrey Yasskin 2b860db35c Doh! os.read() raises an OSError, not an IOError when it's interrupted.
And fix some flakiness in test_itimer_prof, which could detect that the timer
had reached 0 before the signal arrived announcing that fact.
2008-04-04 04:51:19 +00:00
Amaury Forgeot d'Arc d7a265129c #1733757: the interpreter would hang on shutdown, if the function set by sys.settrace
calls threading.currentThread.

The correction somewhat improves the code, but it was close.
Many thanks to the "with" construct, which turns python code into C calls.

I wonder if it is not better to sys.settrace(None) just after
running the __main__ module and before finalization.
2008-04-03 23:07:55 +00:00
Barry Warsaw 9649cdd5d4 Updating for 2.6a2 2008-04-03 04:10:02 +00:00
Amaury Forgeot d'Arc f7cf388c31 Remove debug prints; the buildbot now passes the tests 2008-04-02 21:18:46 +00:00
Vinay Sajip e5aefa0b30 Fix: #2315, #2316, #2317: TimedRotatingFileHandler - changed logic to better handle daylight savings time, deletion of old log files, and fixed a bug in calculating rollover when no logging occurs for a longer interval than the rollover period. 2008-04-02 21:09:27 +00:00
Neal Norwitz d0a91afa70 Apply same patch from 3k branch to try and prevent this test from hanging
on various platforms, most recently the Alpha Tru64.
2008-04-02 05:54:27 +00:00
Jeffrey Yasskin ab56131720 Try to make test_signal less flaky. I still see some flakiness in
test_itimer_prof.
2008-04-02 04:07:44 +00:00
Amaury Forgeot d'Arc cb0f2ad0c2 A DocTestSuite cannot run multiple times: it clears its globals dictionary after the first run.
Rebuild the DocTestSuite on each iteration.
2008-04-02 00:55:04 +00:00
Amaury Forgeot d'Arc 4d0c1170ef Correct the apparent refleak in test_io:
When cls is an ABCMeta, every call to isinstance(x, cls)
records type(x) in the cls._abc_cache of cls_abc_negative_cache.
So we clear these caches at the end of the test.

inspect.isabstract() is not the correct test for all ABCs, because there is no @abstractmethod in io.py (why?)
isinstance(cls, ABCMeta) would be more exact, but it fails with an infinite recursion.
So I used a hack to determine whether a class is an ABCMeta.

The true correction would be to turn cls._abc_cache &co into a WeakSet, as py3k does.
But classic classes are not weak referenceable...

Of course, this change should not be merged into the py3k branch.
2008-04-02 00:25:14 +00:00
Amaury Forgeot d'Arc f0a49708eb Newly enabled test appears to leak:
it registers the same codec on each iteration.
Do it only once at load time.
2008-04-01 22:52:48 +00:00
Amaury Forgeot d'Arc ce6f6c12c6 Fix and enable a skipped test:
with python 2.6, enumerating bytes yields 1-char strings, not numbers.

Don't merge this into the py3k branch.
2008-04-01 22:37:33 +00:00
Brett Cannon 8820f2a979 Add ``if __name__ == '__main__'`` to some test files where it didn't take a lot
of effort to do so.
2008-04-01 12:46:02 +00:00
Brett Cannon 8d2a90af2d Generalize test.test_support.test_stdout() with a base context manager so that
it is easy to capture stderr if desired.
2008-04-01 12:37:43 +00:00
Neal Norwitz d48a2f77f0 Be sure to close the file. 2 places were deleting the file, so it was probably
fine, but the last change may be required for the test to pass on Windows.
Should we always close the mmap too?
2008-04-01 05:40:43 +00:00
Martin v. Löwis affbe80a54 Merged revisions 61990-62079 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r62017 | david.wolever | 2008-03-28 21:54:37 +0100 (Fr, 28 Mär 2008) | 1 line

  Fixed an out-of-date comment.
........
2008-03-31 05:20:55 +00:00
Jeffrey Yasskin 105f3d4fdc Block the sys.exc_clear -3 warning from threading.py. 2008-03-31 00:35:53 +00:00
Georg Brandl e34c21c2a0 Make AST nodes pickleable. 2008-03-30 20:20:39 +00:00
Georg Brandl 2c55c597fa Make _fields attr for no fields consistent with _attributes attr. 2008-03-30 19:00:49 +00:00
Georg Brandl ebc8dedd19 Convert test_ast to unittest and add a test for r62049. 2008-03-30 07:09:22 +00:00
Georg Brandl c87c5800e7 Adapt test_ast to the new ExceptHandler type. 2008-03-30 06:53:55 +00:00
Benjamin Peterson 5b63acd31e #2503 make singletons compared with "is" not == or !=
Thanks to Wummel for the patch
2008-03-29 15:24:25 +00:00
Amaury Forgeot d'Arc 672fbf5195 Still investigating on the hanging test_socket.
the test itself doesn't do anything on windows, focus on setUp and tearDown.
2008-03-29 14:53:05 +00:00
Amaury Forgeot d'Arc 5e08e8b15c The buildbot "x86 W2k8 trunk" seems to hang in test_socket.
http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0

Temporarily increase verbosity of this test.
2008-03-29 13:47:05 +00:00
Georg Brandl f2bfd54d6f Properly check for consistency with the third argument of
compile() when compiling an AST node.
2008-03-29 13:24:23 +00:00
Amaury Forgeot d'Arc ea13dc629c Now that Lib/test/output is gone, tests should not print anything,
except in verbose mode.
Support code is much simpler.
2008-03-29 13:14:52 +00:00
Amaury Forgeot d'Arc bae17a8aa1 lib2to3 should install a logging handler only when run as a main program,
not when used as a library.

This may please the buildbots, which fail when test_lib2to3 is run before test_logging.
2008-03-29 12:42:54 +00:00
Amaury Forgeot d'Arc 2aece57d7f Correctly call the base class tearDown();
otherwise running test_logging twice produce the errors we see on all buildbots
2008-03-29 01:42:31 +00:00
Amaury Forgeot d'Arc 504a48f90a Revert my experiment. I found one reason of failures in test_logging. 2008-03-29 01:41:08 +00:00
Amaury Forgeot d'Arc 554d4f0c13 At least let the module compile 2008-03-29 00:49:07 +00:00
Amaury Forgeot d'Arc 8a69707b80 Try to understand why most buildbots suddenly turned to red.
Undo the only change that might have unexpected effects.

To be followed.
2008-03-29 00:44:58 +00:00
Benjamin Peterson 41cf50d613 #2498 modernized try, except, finally statements in bdb 2008-03-28 20:56:00 +00:00
Gregory P. Smith a98be45f18 These svn adds were forgotten in r62000 2008-03-28 20:11:49 +00:00
Gerhard Häring 2a11c05b9d Update sqlite3 module to match current version of pysqlite. 2008-03-28 20:08:36 +00:00
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