Commit Graph

19084 Commits

Author SHA1 Message Date
Éric Araujo e64e51bfa7 Make “pydoc somebuiltin.somemethod” work (#8887) 2011-07-29 17:03:55 +02:00
Éric Araujo 0bbacc621c Branch merge 2011-07-29 14:30:03 +02:00
Éric Araujo 158d7696f3 Branch merge 2011-07-29 14:24:08 +02:00
Raymond Hettinger abe9dc3f30 Issue 12514: Use try/finally to assure that timeit restores GC when done. 2011-07-29 00:08:19 -07:00
Raymond Hettinger 3a081f526d Issue 12514: Use try/finally to assure that timeit restores GC when done. 2011-07-29 00:02:04 -07:00
Eli Bendersky 906b88fb2a Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
As a side effect, this now allows the rjust, ljust and center methods of
bytes and bytearray to accept a bytearray argument.

Patch by Petri Lehtinen
2011-07-29 07:05:08 +03:00
Éric Araujo bab50cb124 Minor packaging cleanup.
- Use shortcut dist.version instead of going through metadata;
- Use %r throughout to display project names and paths.
2011-07-29 02:37:21 +02:00
Éric Araujo 7b0908a8e4 Make TypeError message from Command.__init__ more useful 2011-07-29 02:32:41 +02:00
Éric Araujo 943006bf68 Let all pysetup actions return a meaningful 0 or 1 exit code (#12222).
This will help scripts calling pysetup know if a command failed.
Printing/logging was also made more consistent, and a few things were
cleaned up.  In particular, the error/Ctrl-C handling was moved from the
_run function up to the main function.

The run action is not fixed yet; it returns the dist.Distribution
instance, which is needed by test_uninstall and not trivial to fix.
2011-07-29 02:31:39 +02:00
Éric Araujo 73c175f5a0 Let pysetup list exit with a non-zero code when no result is found (#11409).
“pysetup list” or “pysetup list --all” will continue to return 0 if no
distribution is found (it’s not an error), but “pysetup list
some.project” will now exit with 1 if no matching installed distribution
is found.  Based on a patch by Kelsey Hightower.
2011-07-29 02:20:39 +02:00
Éric Araujo 2527796a22 Merge from 3.2 (#10318, #12255, #12043, #12417 and other fixes) 2011-07-29 03:11:09 +02:00
Éric Araujo 1e3a68d36b Modernize modulefinder module and tests a bit.
The tests don’t use an internal distutils function anymore, and use
regular assertEqual with sorted lists instead of a convoluted manual
diff.
2011-07-28 23:35:29 +02:00
Éric Araujo cf534817ad Branch merge 2011-07-28 23:08:11 +02:00
Éric Araujo fc662ddda2 Merge profile docs followup (#12417) from 3.1 2011-07-28 23:00:14 +02:00
Éric Araujo ee19c772cb Remove mentions of previous license in profile module docs (#12417 followup).
Also remove an extra docstring.
2011-07-28 22:56:24 +02:00
Raymond Hettinger 66d2be8986 Issue 12647: Add __bool__() method to the None object. 2011-07-28 09:55:13 -07:00
Senthil Kumaran a2250e61db merge from 3.2 - Fix closes Issue11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller. 2011-07-28 23:39:08 +08:00
Senthil Kumaran 7c9719cf74 Fix closes Issue11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller. 2011-07-28 22:32:49 +08:00
Éric Araujo 0cdd4454f3 Remove indirection in threading (issue #10968).
The public names (Thread, Condition, etc.) used to be factory functions
returning instances of hidden classes (_Thread, _Condition, etc.),
because (if Guido recalls correctly) this code pre-dates the ability to
subclass extension types.

It is now possible to inherit from Thread and other classes, without
having to import the private underscored names like multiprocessing did.

A doc update will follow: a patch is under discussion on the issue.
2011-07-28 00:28:28 +02:00
Charles-François Natali fd96eb2a68 Issue #11871: In test_threading.BarrierTests, bump the default barrier timeout
to avoid timing-dependent failures.
2011-07-27 21:28:23 +02:00
Charles-François Natali d4d1d068dc Issue #11871: In test_threading.BarrierTests, bump the default barrier timeout
to avoid timing-dependent failures.
2011-07-27 21:26:42 +02:00
Charles-François Natali 7a2f0c7802 Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. 2011-07-27 19:42:05 +02:00
Charles-François Natali 27c4e88552 Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. 2011-07-27 19:40:02 +02:00
Eli Bendersky d18a047d58 Issue #11049: added test_support to regrtest.STDTESTS list 2011-07-27 20:21:45 +03:00
Éric Araujo 9bce311ea4 Add shlex.quote function, to escape filenames and command lines (#9723).
This function used to live as pipes.quote, where it was undocumented but
used anyway.  (An alias still exists for backward compatibility.)  The
tests have been moved as is, but the code of the function was changed to
use a regex instead of a loop with string comparisons (at Ian Bicking’s
suggestion).  I’m terrible at regexes, so any feedback is welcome.
2011-07-27 18:29:31 +02:00
Ross Lagerwall 114f0e499d Issue #12607: Merge with 3.2. 2011-07-27 07:39:27 +02:00
Ross Lagerwall d98646e430 Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.
2011-07-27 07:16:31 +02:00
Senthil Kumaran 4d90b19373 merge from 3.2 - Correcting issue 12576 fix, which resulted in buildbot failures. 2011-07-27 09:32:04 +08:00
Senthil Kumaran 45686b472b Correcting issue 12576 fix, which resulted in buildbot failures. 2011-07-27 09:31:03 +08:00
Ned Deily 12aa1aea67 Issue #12590: IDLE editor window now always displays the first line
when opening a long file.  With Tk 8.5, the first line was hidden.
2011-07-26 18:19:09 -07:00
Ned Deily f25e3d5278 Issue #12590: IDLE editor window now always displays the first line
when opening a long file.  With Tk 8.5, the first line was hidden.
2011-07-26 18:17:33 -07:00
Senthil Kumaran 7496fef8ff merge from 3.2 - Fix closes Issue12576 - fix urlopen behavior on sites which do not send (or obsfuscates) Connection: Close header. 2011-07-27 08:06:44 +08:00
Senthil Kumaran 1299a8f3b2 Fix closes Issue12576 - fix urlopen behavior on sites which do not send (or obsfuscates) Connection: Close header. 2011-07-27 08:05:58 +08:00
Antoine Pitrou 2a20f9be70 Backport 0398f07d4827 (fix for weird buildbot failures) 2011-07-27 01:06:07 +02:00
Antoine Pitrou d05066d1ee Try to fix weird buildbot failures 2011-07-26 23:55:33 +02:00
Ned Deily 0975dedfe0 Issue #8746: Use tempfile module to get tempdir and randomize the
link file name.
2011-07-26 13:56:49 -07:00
Ned Deily ba2eab25ff Issue #8746: Use tempfile module to get tempdir and randomize the
link file name.
2011-07-26 13:53:55 -07:00
Éric Araujo 41bade96a4 Remove duplicates of cmp_to_key (#12542, reviewed by Raymond Hettinger) 2011-07-26 15:13:47 +02:00
Antoine Pitrou 83d21930ab Add debug output for failing buildbot 2011-07-26 14:45:22 +02:00
Vinay Sajip 8188f585b2 Fixes #12637: Merged fix from 3.2 and added test. 2011-07-25 19:58:13 +01:00
Vinay Sajip 45dedaafc2 Fixes #12637: Last resort messages now correctly handled. Thanks to Xavier de Gaye for the patch." 2011-07-25 19:53:28 +01:00
Antoine Pitrou 5a24d82941 Add a test for issue #1813: getlocale() failing under a Turkish locale
(not a problem under 3.x)
2011-07-24 02:41:54 +02:00
Antoine Pitrou 0e3c5a828e Add a test for issue #1813: getlocale() failing under a Turkish locale
(not a problem under 3.x)
2011-07-24 02:40:25 +02:00
Antoine Pitrou cf9d3c08c8 Issue #1813: Fix codec lookup under Turkish locales. 2011-07-24 02:27:04 +02:00
Antoine Pitrou 8dbd8573e5 Issue #12624: It is now possible to fail after the first failure when
running in verbose mode (`-v` or `-W`), by using the `--failfast`
(or `-G`) option to regrtest.  This is useful with long test suites
such as test_io or test_subprocess.
2011-07-23 22:37:52 +02:00
Antoine Pitrou 216a3bc36d Issue #12624: It is now possible to fail after the first failure when
running in verbose mode (`-v` or `-W`), by using the `--failfast`
(or `-G`) option to regrtest.  This is useful with long test suites
such as test_io or test_subprocess.
2011-07-23 22:33:39 +02:00
Antoine Pitrou e02891b459 Issue #12591: Improve support of "universal newlines" in the subprocess
module: the piped streams can now be properly read from or written to.
2011-07-23 22:04:41 +02:00
Antoine Pitrou ab85ff3d1a Issue #12591: Improve support of "universal newlines" in the subprocess
module: the piped streams can now be properly read from or written to.

(this was broken due to the 2.x to 3.x transition; communicate() support
is still sketchy)
2011-07-23 22:03:45 +02:00
Antoine Pitrou d42c1d09e9 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add a *write_through* parameter to
mandate unbuffered writes.
2011-07-23 21:50:21 +02:00
Antoine Pitrou e96ec68101 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add an undocumented *write_through* parameter to
mandate unbuffered writes.
2011-07-23 21:46:35 +02:00
Nadeem Vawda 0200016132 Merge: #10883: Fix socket leaks in urllib.request.
* ftpwrapper now uses reference counting to ensure that the underlying socket
  is closed when the ftpwrapper object is no longer in use
* ftplib.FTP.ntransfercmd() now closes the socket if an error occurs

Initial patch by Victor Stinner.
2011-07-23 14:25:45 +02:00
Nadeem Vawda 08f5f7aa81 Issue #10883: Fix socket leaks in urllib.request.
* ftpwrapper now uses reference counting to ensure that the underlying socket
  is closed when the ftpwrapper object is no longer in use
* ftplib.FTP.ntransfercmd() now closes the socket if an error occurs

Initial patch by Victor Stinner.
2011-07-23 14:03:00 +02:00
Eli Bendersky 7cd94a1e23 Issue #11049: skip a test that fails on some buildbots 2011-07-23 15:00:31 +03:00
Senthil Kumaran 714c53c540 merge from 3.2 - Fix closes issue12581 - Increase the urllib.parse test coverage. Patch by Petter Haggholm. 2011-07-23 18:28:43 +08:00
Senthil Kumaran de02a7194c Fix closes issue12581 - Increase the urllib.parse test coverage. Patch by Petter Haggholm. 2011-07-23 18:27:45 +08:00
Eli Bendersky d11c3e32c5 fixing whitespace in the previous commit 2011-07-23 08:51:14 +03:00
Eli Bendersky 6c51999221 Issue #11049: adding some tests to test.support
Based on original patch by Giampaolo Rodola with contributions from R. David Murray
2011-07-23 08:48:53 +03:00
Benjamin Peterson 86f088e8e5 merge 3.2 2011-07-22 10:55:02 -05:00
Benjamin Peterson 2193d2b72b type check AST strings and identifiers
This is related to a21829180423 as well as #12609 and #12610.
2011-07-22 10:50:23 -05:00
Ezio Melotti a30def6c66 #12601: merge with 3.2. 2011-07-21 11:17:05 +03:00
Ezio Melotti 1beea5b7c1 #12601: fix typo. 2011-07-21 11:16:32 +03:00
Antoine Pitrou d649480739 Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
to get channel binding data for the current SSL session (only the
"tls-unique" channel binding is implemented).  This allows the
implementation of certain authentication mechanisms such as SCRAM-SHA-1-PLUS.

Patch by Jacek Konieczny.
2011-07-21 01:11:30 +02:00
R David Murray 875048bd4c #665194: support roundtripping RFC2822 date stamps in the email.utils module 2011-07-20 11:41:21 -04:00
Antoine Pitrou fb96089b13 Fix test_multiprocessing failure under Windows.
(followup to dfaa3a149a92)
2011-07-20 02:01:39 +02:00
Ned Deily dac7de3102 Issue #12587: Correct faulty test file and reference in test_tokenize.
(Patch by Robert Xiao)
2011-07-19 16:18:11 -07:00
Ned Deily 2ea6fccf64 Issue #12587: Correct faulty test file and reference in test_tokenize.
(Patch by Robert Xiao)
2011-07-19 16:15:27 -07:00
Antoine Pitrou 7b561ec98f Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2 directory,
so that "import DLFCN" and other similar imports work on Linux 3.0.
2011-07-20 00:28:21 +02:00
Antoine Pitrou c57ed91e0c Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2 directory,
so that "import DLFCN" and other similar imports work on Linux 3.0.
2011-07-20 00:26:23 +02:00
R David Murray 4c14bba7f9 #7484: simplify quoteaddr: if parseaddr throws an error it is a bug.
As far as I can tell, the try/except was ancient code, from before the email
package rewrite where the philosophy of never throwing parsing errors was
adopted.
2011-07-18 21:59:53 -04:00
R David Murray da7af4d7a1 Merge #7484: no more <> around addresses in VRFY or EXPN 2011-07-18 21:42:28 -04:00
R David Murray 4634676cec #7484: no more <> around addresses in VRFY or EXPN
The RFC doesn't say that they are allowed; apparently many mailers accept
them, but not postfix.  Contributions to this patch were made by Felipe Cruz
and Catalin Iacob.

The changeset also adds additional indirect tests for quoteaddr (null address
and IDNA-encoded address).
2011-07-18 21:38:54 -04:00
Eric V. Smith c12469df22 Merge from 3.2. 2011-07-18 14:08:55 -04:00
Eric V. Smith 12ebefc9d3 Closes #12579. Positional fields with str.format_map() now raise a ValueError instead of SystemError. 2011-07-18 14:03:41 -04:00
Benjamin Peterson bd9c655c97 merge heads 2011-07-17 22:50:12 -05:00
Benjamin Peterson 76f7f4d979 excise the remains of STOP_CODE, which hasn't done anything useful for years 2011-07-17 22:49:50 -05:00
Brett Cannon 52a7d98273 Make warnings accept a callable for showwarnings instead of
restricting itself to just functions and methods (which allows
built-in functions to be used, etc.).

Closes issue #10271. Thanks to lekma for the bug report.
2011-07-17 19:17:55 -07:00
Alex Gaynor e151d21883 Mark itertools tests of tuple reuse as being specific to CPython. 2011-07-17 16:21:30 -07:00
Antoine Pitrou 0b447957c7 Close the call queue in concurrent.futures.ProcessPoolExecutor when
shutdown() is called, without waiting for the garbage collector to kick in.
2011-07-16 23:52:02 +02:00
Benjamin Peterson 7dc35f6fea merge heads 2011-07-15 21:10:44 -05:00
Benjamin Peterson 0bd152cd67 remove ast.__version__ (closes #12273) 2011-07-15 21:10:13 -05:00
Antoine Pitrou dc19c24832 Silence spurious "broken pipe" tracebacks when shutting down a ProcessPoolExecutor. 2011-07-16 01:51:58 +02:00
Antoine Pitrou d06a065a44 Fix potential resource leaks in concurrent.futures.ProcessPoolExecutor
by joining all queues and processes when shutdown() is called.
2011-07-16 01:13:34 +02:00
Antoine Pitrou db535957cd test_packaging should clean up after itself (but it doesn't really) 2011-07-15 23:26:19 +02:00
Antoine Pitrou 9e42a4dbaa Fix whitespace 2011-07-15 23:09:58 +02:00
Antoine Pitrou 075050f84f test_threaded_import must clean up after itself 2011-07-15 23:09:13 +02:00
Antoine Pitrou f26ad7149f test_os needs to reap threads 2011-07-15 23:00:56 +02:00
Antoine Pitrou afed6ecf21 Merge from 3.2 2011-07-15 22:43:33 +02:00
Antoine Pitrou f7f54759b5 Use test.script_helper in test_pydoc 2011-07-15 22:42:12 +02:00
Antoine Pitrou a6e81a23b3 test_pydoc needs to cleanup after itself 2011-07-15 22:32:25 +02:00
Antoine Pitrou 707f228b1e Try harder to reap dangling threads in test.support.reap_threads(). 2011-07-15 22:29:44 +02:00
Antoine Pitrou 428bc6c48f Issue #12573: Add resource checks for dangling Thread and Process objects. 2011-07-15 22:15:38 +02:00
Antoine Pitrou c081c0c6a0 Issue #12573: Add resource checks for dangling Thread and Process objects. 2011-07-15 22:12:24 +02:00
Antoine Pitrou 91fe8157fd Merge 2011-07-15 21:19:27 +02:00
Antoine Pitrou b8298a01e6 Merge 2011-07-15 21:19:02 +02:00
Antoine Pitrou 9b43b6e14e Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:18:18 +02:00
Antoine Pitrou ff35050493 Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:17:14 +02:00
Antoine Pitrou 8cdc40e3b0 Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:15:07 +02:00
Benjamin Peterson 58059197cc merge heads 2011-07-15 14:11:23 -05:00
Benjamin Peterson 1a41d7d51d merge heads 2011-07-15 14:10:59 -05:00
Benjamin Peterson e92cd0ce98 merge 3.2 (#11627) 2011-07-15 14:10:35 -05:00
Benjamin Peterson 5afa03a72e catch nasty exception classes with __new__ that doesn't return a exception (closes #11627)
Patch from Andreas Stührk.
2011-07-15 14:09:26 -05:00
Antoine Pitrou 8f629059db Make sure to reap worker threads and processes at the end of test_concurrent_futures 2011-07-15 20:26:35 +02:00
Antoine Pitrou 9470ab43a9 Make sure to reap worker threads and processes at the end of test_concurrent_futures 2011-07-15 20:25:20 +02:00
Éric Araujo af5bacf9bb Always use repr for regrtest resources names 2011-07-15 17:50:15 +02:00
Éric Araujo eb39294101 Silence 2to3 warnings in packaging tests 2011-07-15 17:49:20 +02:00
Éric Araujo fe95848c16 Clear packaging.database caches in place 2011-07-15 17:47:46 +02:00
Victor Stinner d33344a030 Add cgi.closelog() function to close the log file 2011-07-14 22:28:36 +02:00
Charles-François Natali f64f9e9ec1 Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. 2011-07-14 20:00:49 +02:00
Charles-François Natali 1f0ccfa853 Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. 2011-07-14 19:57:35 +02:00
Charles-François Natali e22813067e Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. 2011-07-14 19:53:38 +02:00
Benjamin Peterson b6ffa7980f test that TestCase doesn't get cycles 2011-07-14 12:48:25 -05:00
Benjamin Peterson 31f4beb15e add a contextmanager to disable the gc 2011-07-14 12:48:01 -05:00
Benjamin Peterson c917494528 merge 3.2 2011-07-14 10:03:53 -05:00
Benjamin Peterson eef80b6e70 this should be an identity test 2011-07-14 10:03:35 -05:00
Victor Stinner bc18838972 (merge 3.2) Issue #12250: test_socketserver uses a timeout of 60 seconds
instead of 20

test_shutdown() may fail on very slow buildbots like FreeBSD 6.4 just because
of the arbitrary timeout.
2011-07-14 15:36:16 +02:00
Ezio Melotti e73d49d328 Merge with 3.2. 2011-07-14 15:57:12 +03:00
Victor Stinner 5702ae6f3f Issue #12250: test_socketserver uses a timeout of 60 seconds instead of 20
test_shutdown() may fail on very slow buildbots like FreeBSD 6.4 just because
of the arbitrary timeout.
2011-07-14 14:53:24 +02:00
Ezio Melotti 7ebb706133 Restore the global state of the log vars, so that test_cgi can be run twice without failures. 2011-07-14 15:18:57 +03:00
Benjamin Peterson d77e2eaa40 merge 3.2 2011-07-13 23:11:14 -05:00
Benjamin Peterson 6e18e04273 carefully cleanup pointer cache after creating struct pointers 2011-07-13 23:09:30 -05:00
Vinay Sajip bf9c021ddd Closes #12536: Unused logger removed from lib2to3. 2011-07-13 23:15:07 +01:00
Ned Deily 07b353716c Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
as the processor type on some Mac systems.
2011-07-13 15:09:49 -07:00
Ned Deily 58e3350bd4 Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
as the processor type on some Mac systems.  Also fix NameError in fallback
_mac_ver_gestalt function.  And remove out-of-date URL in docs.
2011-07-13 15:07:04 -07:00
Victor Stinner cb41cda8e3 Issue #12550: regrtest displays the Python traceback on SIGALRM or SIGUSR1 2011-07-13 23:47:21 +02:00
Victor Stinner a9a9dab042 Issue #12550: Add chain optional argument to faulthandler.register()
Call the previous signal handler if chain is True.
2011-07-13 23:39:53 +02:00
Victor Stinner d93da2b952 (merge 3.2) Close #4376: ctypes now supports nested structures in a endian
different than the parent structure. Patch by Vlad Riscutia.
2011-07-13 21:45:16 +02:00
Victor Stinner 6636121950 Close #4376: ctypes now supports nested structures in a endian different than
the parent structure. Patch by Vlad Riscutia.
2011-07-13 21:43:18 +02:00
Benjamin Peterson 0850638957 merge 3.2 (#12544) 2011-07-12 19:23:43 -05:00
Benjamin Peterson 34b2b263db this can be done without a custom dict (also fixes #12544) 2011-07-12 19:21:42 -05:00
Antoine Pitrou 093c8e4bf0 Issue #12149: Update the method cache after a type's dictionnary gets
cleared by the garbage collector.  This fixes a segfault when an instance
and its type get caught in a reference cycle, and the instance's
deallocator calls one of the methods on the type (e.g. when subclassing
IOBase).

Diagnosis and patch by Davide Rizzo.
2011-07-12 21:58:39 +02:00
Antoine Pitrou 84f1b1718d Issue #12149: Update the method cache after a type's dictionnary gets
cleared by the garbage collector.  This fixes a segfault when an instance
and its type get caught in a reference cycle, and the instance's
deallocator calls one of the methods on the type (e.g. when subclassing
IOBase).

Diagnosis and patch by Davide Rizzo.
2011-07-12 21:57:15 +02:00
Georg Brandl 00ebeb540f Merge 3.2.1 release clone into main repo. 2011-07-09 10:58:37 +02:00
Georg Brandl cd0dc16fdc Bump version to 3.2.1. 2011-07-09 08:56:21 +02:00
Antoine Pitrou 13d7db19f6 Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
failure in name resolution.

Should fix a buildbot failure.
2011-07-09 02:32:36 +02:00
Antoine Pitrou 4875c46538 Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
failure in name resolution.

Should fix a buildbot failure.
2011-07-09 02:31:24 +02:00
Antoine Pitrou 9163c473dc Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
failure in name resolution.

Should fix a buildbot failure.
2011-07-09 02:31:24 +02:00
Antoine Pitrou 600012028e Add comment 2011-07-09 01:03:46 +02:00
Antoine Pitrou 71a28a9174 Rebind locally the globals which can be looked up at shutdown
(to avoid the warnings seen on a buildbot)
2011-07-09 01:03:00 +02:00
Antoine Pitrou 4a183b47f3 Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
Web site.
2011-07-08 19:44:55 +02:00
Antoine Pitrou 95531ea2f1 Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
Web site.
2011-07-08 19:43:51 +02:00
Antoine Pitrou 88fcf1bcab Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name.  The test
is now skipped instead.
2011-07-08 19:22:31 +02:00
Antoine Pitrou 3aba49899c Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name.  The test
is now skipped instead.
2011-07-08 19:19:57 +02:00
Antoine Pitrou 72fff046a6 Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name.  The test
is now skipped instead.
2011-07-08 19:19:57 +02:00
Antoine Pitrou 7128f95bd2 Issue #12440: When testing whether some bits in SSLContext.options can be
reset, check the version of the OpenSSL headers Python was compiled against,
rather than the runtime version of the OpenSSL library.
2011-07-08 18:49:07 +02:00
Antoine Pitrou b9ac25d1c3 Issue #12440: When testing whether some bits in SSLContext.options can be
reset, check the version of the OpenSSL headers Python was compiled against,
rather than the runtime version of the OpenSSL library.
2011-07-08 18:47:06 +02:00
Éric Araujo 4468e55d4b Close file handles in a timely manner in packaging.database (#12504).
This fixes a bug with the remove (uninstall) feature on Windows.  Patch
by Thomas Holmes.
2011-07-08 17:22:19 +02:00
Éric Araujo ce5fe83878 Factor out code used by packaging commands for HTTP requests (#12169).
We now have one function to prepare multipart POST requests, and we use
CRLF, as recommended by the HTTP spec (#10150).  Initial patch by John
Edmonds.
2011-07-08 16:27:12 +02:00
Ned Deily f6cbdc22be Issue #8716: Instead of relying on Aqua Tk exceptions to detect lack of
OS X window manager connection in tk tests, use OS X Application Services
API calls instead.
2011-07-05 19:09:37 -07:00
Victor Stinner 1848db891b Issue #12493: skip test_communicate_eintr() if signal.SIGALRM is missing 2011-07-05 14:49:46 +02:00
Victor Stinner 91e08772a6 Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support Python
scripts using a encoding different than UTF-8 (read the coding cookie of the
script).
2011-07-05 14:30:41 +02:00
Victor Stinner 2cfb6f3aa0 Issue #12493: subprocess: communicate() handles EINTR
subprocess.Popen.communicate() now also handles EINTR errors if the process has
only one pipe.
2011-07-05 14:00:56 +02:00
Ned Deily e2d519035f Issue #12497: Install test/data to prevent failures of the various codecmaps
tests.
2011-07-04 19:06:20 -07:00
Georg Brandl bfd1edd155 Merge 3.2.1 release clone changes into main 3.2 branch after 3.2.1rc2 release. 2011-07-04 19:55:22 +02:00
Victor Stinner e40b3aabfb Issue #12469: Run "wakeup" signal tests in subprocess to run the test in a
fresh process with only one thread and to not change signal handling of the
parent process.
2011-07-04 17:35:10 +02:00
Victor Stinner 4479841b83 Issue #12429: Skip interrupted write tests on FreeBSD <= 7
On FreeBSD, the SIGALRM signal is sometimes received by the reader thread.
2011-07-04 11:48:17 +02:00
Victor Stinner cd1aa0d5ea Issue #12429: Skip interrupted write tests on FreeBSD <= 7
On FreeBSD, the SIGALRM signal is sometimes received by the reader thread.
2011-07-04 11:48:17 +02:00
Ned Deily 4143535d86 Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
test_tk or test_ttk_guionly under a username that is not currently logged
in to the console windowserver (as may be the case under buildbot or ssh).
2011-07-03 21:56:48 -07:00
Senthil Kumaran 9ebe08d2f6 Fix closes issue12471 - wrong TypeError message when '%i' format spec was used. 2011-07-03 21:03:16 -07:00
Senthil Kumaran c8763b9d96 Fix closes issue issue12470 - check for utime for the skipUnless condition. 2011-07-03 18:21:38 -07:00
Senthil Kumaran 0c2dba5726 Fix closes issue issue12470 - check for utime for the skipUnless condition. 2011-07-03 18:21:38 -07:00
Victor Stinner b1b25f0ffd Issue #12467: warnings: fix a race condition if a warning is emitted at
shutdown, if globals()['__file__'] is None.
2011-07-04 02:43:09 +02:00
Victor Stinner 8b0508ed4e Issue #12467: warnings: fix a race condition if a warning is emitted at
shutdown, if globals()['__file__'] is None.
2011-07-04 02:43:09 +02:00
Senthil Kumaran 80dffefcd9 Fix closes issue12438 - idlelib.PyShell's showformatwarning method was passing an incorrect arg. 2011-07-03 17:39:20 -07:00
Senthil Kumaran aa90e7c573 Fix closes issue12438 - idlelib.PyShell's showformatwarning method was passing an incorrect arg. 2011-07-03 17:39:20 -07:00
Senthil Kumaran 7079240c4a Fix closes issue12432 - remove the unused sys from glob.py 2011-07-03 17:21:05 -07:00
Victor Stinner e975af62f2 Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
instead of text mode using the locale encoding, to avoid encoding issues.
2011-07-04 02:08:50 +02:00
Victor Stinner 6c47102982 Issue #12451: runpy: run_path() now opens the Python script in binary mode,
instead of text mode using the locale encoding, to support other encodings than
UTF-8 (scripts using the coding cookie).
2011-07-04 01:45:39 +02:00
Victor Stinner bbdc08ea6e Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead
of the text mode (using the locale encoding) to avoid encoding issues.
2011-07-04 01:25:55 +02:00
Benjamin Peterson ac91341333 never retain a generator's caller's exception state on the generator after a yield/return
This requires some trickery to properly save the exception state if the
generator creates its own exception state.
2011-07-03 16:25:11 -05:00
Benjamin Peterson d2ed630243 merge heads 2011-07-03 13:44:56 -05:00
Benjamin Peterson 83195c3f0c restore a generator's caller's exception state both on yield and (last) return
This prevents generator exception state from leaking into the caller.

Closes #12475.
2011-07-03 13:44:00 -05:00
Georg Brandl d4fa7ed8db Bump to 3.2.1rc2. 2011-07-03 09:41:27 +02:00
Georg Brandl fa76ceb3c8 Update pydoc topics. 2011-07-03 09:31:04 +02:00
Victor Stinner 2cded9c3f3 Issue #12016: Multibyte CJK decoders now resynchronize faster
They only ignore the first byte of an invalid byte sequence.

For example, b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of
'\ufffd'.
2011-07-08 01:45:13 +02:00
Vinay Sajip 0bec35d2d0 Closes #12391: temporary files are now cleaned up. 2011-07-07 12:59:31 +01:00
Georg Brandl cd9f1203a4 Revert 76452b892838 as per http://mail.python.org/pipermail/python-dev/2011-July/112243.html. 2011-07-06 07:31:38 +02:00
Ned Deily 8a3b988b8a Issue #8716: Instead of relying on Aqua Tk exceptions to detect lack of
OS X window manager connection in tk tests, use OS X Application Services
API calls instead.
2011-07-05 19:11:15 -07:00
Brian Curtin 692e26be46 Normalize whitespace for #11512 fix. 2011-07-05 19:16:37 -05:00
Brian Curtin 6a4ffd7295 Fix #11512. Add an initial test suite for the cgitb, providing 75% coverage.
Patch by Robbie Clemons (robquad), produced at the PyCon 2011 sprints.
2011-07-05 19:14:16 -05:00
Victor Stinner 7f53a5027d Issue #12459: time.sleep() now raises a ValueError if the sleep length is
negative, instead of an infinite sleep on Windows or raising an IOError on
Linux for example, to have the same behaviour on all platforms.
2011-07-05 22:00:25 +02:00
Victor Stinner 5351a1f956 (merge 3.2) Issue #12493: skip test_communicate_eintr() if signal.SIGALRM is missing 2011-07-05 14:50:08 +02:00
Victor Stinner d7772bc4cb (merge 3.2) Issue #12451: pydoc: html_getfile() now uses tokenize.open() to
support Python scripts using a encoding different than UTF-8 (read the coding
cookie of the script).
2011-07-05 14:31:28 +02:00
Victor Stinner 5b1261d750 (merge 3.2) Issue #12493: subprocess: communicate() handles EINTR
subprocess.Popen.communicate() now also handles EINTR errors if the process has
only one pipe.
2011-07-05 14:04:39 +02:00
Ned Deily 368ff10c4d Issue #12497: Install test/data to prevent failures of the various codecmaps
tests.
2011-07-04 19:11:14 -07:00
Victor Stinner 5dd470ef1d Issue #12469: fix signal order check of test_signal
When signals are unblocked, pending signal ared delivered in the reverse order
of their number (also on Linux, not only on FreeBSD 6).

Don't sort signals by their number if signals were not blocked (test_signum).
2011-07-05 01:32:06 +02:00
Victor Stinner 68757ac884 Issue #12469: test_signal checks wakeup signals order, except on freebsd6
On FreeBSD 6, when signals are unblocked, FreeBSD 6 delivers signals in the
reverse order of their number.
2011-07-05 01:15:08 +02:00
Victor Stinner 87e78ce1c6 Issue #12469: partial revert of 024827a9db64, freebsd6 thread initialization
* Don't create a thread at startup anymore to initialize the pthread library:
   it changes the behaviour of many functions related to signal handling like
   sigwait()
 * Reenable test_sigtimedwait_poll() on FreeBSD 6
2011-07-04 22:53:49 +02:00
Victor Stinner 0a01f13af8 Issue #12469: replace assertions by explicit if+raise 2011-07-04 18:06:35 +02:00
Victor Stinner d554cdf8b9 (merge 3.2) Issue #12469: Run wakeup and pending signal tests in a subprocess
to run the test in a fresh process with only one thread and to not change
signal handling of the parent process.
2011-07-04 17:49:40 +02:00
Victor Stinner b575289292 Issue #12452: Plist and Dict are now deprecated
Replace PendingDeprecationWarning warnings by DeprecationWarning.
2011-07-04 14:28:45 +02:00
Ned Deily efa384aa27 Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
test_tk or test_ttk_guionly under a username that is not currently logged
in to the console windowserver (as may be the case under buildbot or ssh).
2011-07-03 22:27:16 -07:00
Senthil Kumaran bc9d8f838b merge from 3.2 2011-07-03 21:05:25 -07:00
Senthil Kumaran cc78c443f2 merge from 3.2 2011-07-03 18:22:14 -07:00
Victor Stinner 5a21e83119 (merge 3.2) Issue #12467: warnings: fix a race condition if a warning is
emitted at shutdown, if globals()['__file__'] is None.
2011-07-04 02:56:10 +02:00
Senthil Kumaran 10cdc63dd4 Merge from 3.2. 'idle_formatwarning' is the correct method name. 2011-07-03 17:40:39 -07:00
Senthil Kumaran ad1013c338 merge from 3.2 2011-07-03 17:21:44 -07:00
Victor Stinner 5f9a995ad7 (merge 3.2) Issue #12451: pydoc: importfile() now opens the Python script in
binary mode, instead of text mode using the locale encoding, to avoid encoding
issues.
2011-07-04 02:09:44 +02:00
Victor Stinner 7d8c8a095a (merge 3.2) Issue #12451: runpy: run_path() now opens the Python script in
binary mode, instead of text mode using the locale encoding, to support other
encodings than UTF-8 (scripts using the coding cookie).
2011-07-04 01:47:40 +02:00
Victor Stinner 3663abab59 (merge 3.2) Issue #12451: xml.dom.pulldom: parse() now opens files in binary
mode instead of the text mode (using the locale encoding) to avoid encoding
issues.
2011-07-04 01:27:37 +02:00
Benjamin Peterson 536feac7f8 merge 3.2 2011-07-03 16:27:41 -05:00
Benjamin Peterson 7b7099c36f merge 3.2 (#12475) 2011-07-03 13:48:36 -05:00
Georg Brandl aeaeefa88b Remove mention of medical condition from the test suite. 2011-07-03 19:22:42 +02:00
Antoine Pitrou 1c405b3e60 Followup to 51c1f2cedb96 (and issue #12456):
qsize() raises NotImplementedError on OS X, don't use it.
2011-07-03 13:17:06 +02:00
R David Murray db4120bf9d merge #12147: make send_message correctly handle Sender and Resent- headers. 2011-07-02 21:10:44 -04:00
R David Murray ac4e5abc78 #12147: make send_message correctly handle Sender and Resent- headers.
Original patch by Nicolas Estibals.  My tweaks to the patch were mostly
style/cosmetic, and adding more tests.
2011-07-02 21:03:19 -04:00
Antoine Pitrou 020436b0d4 Issue #12456: fix a possible hang on shutdown of a concurrent.futures.ProcessPoolExecutor. 2011-07-02 21:20:25 +02:00
Vinay Sajip 65897a386e Closes #12291 for 3.3 - merged fix from 3.2. 2011-07-02 17:16:02 +01:00
Vinay Sajip 5bdae3bb7c Closes #12291: Fixed bug which was found when doing multiple loads from one stream. 2011-07-02 16:42:47 +01:00
Éric Araujo 2ee61884fe Clean up NEWS entry and tests for shutil.disk_usage (#12442) 2011-07-02 16:45:45 +02:00
Charles-François Natali 723585bbaf Merge issue #12352: Fix a deadlock in multiprocessing.Heap when a block is
freed by the garbage collector while the Heap lock is held.
2011-07-02 14:43:11 +02:00
Charles-François Natali a4a04069fd Merge issue #12352: Fix a deadlock in multiprocessing.Heap when a block is
freed by the garbage collector while the Heap lock is held.
2011-07-02 14:39:53 +02:00
Charles-François Natali 778db49da9 Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
the garbage collector while the Heap lock is held.
2011-07-02 14:35:49 +02:00
R David Murray 7ae4448ed2 merge #11873: another try at fixing the regex, courtesy of Victor Stinner 2011-07-01 14:57:00 -04:00
R David Murray ee1a7cb4a4 #11873: another try at fixing the regex, courtesy of Victor Stinner 2011-07-01 14:55:43 -04:00
R David Murray 296b96c635 merge #11873: fix test regex so it covers windows os.sep as well. 2011-07-01 11:53:19 -04:00
R David Murray a3bb2f5514 #11873: fix test regex so it covers windows os.sep as well. 2011-07-01 11:51:50 -04:00
Victor Stinner 19e5bcdd9c (merge 3.2) Issue #12363: increase the timeout of siginterrupt() tests
Move also the "ready" trigger after the installation of the signal handler and
the call to siginterrupt().

Use a timeout of 5 seconds instead of 3. Two seconds are supposed to be enough,
but some of our buildbots are really slow (especially the FreeBSD 6 VM).
2011-07-01 15:59:54 +02:00
Victor Stinner dfde0d4650 Issue #12363: increase the timeout of siginterrupt() tests
Move also the "ready" trigger after the installation of the signal handler and
the call to siginterrupt().

Use a timeout of 5 seconds instead of 3. Two seconds are supposed to be enough,
but some of our buildbots are really slow (especially the FreeBSD 6 VM).
2011-07-01 15:58:39 +02:00
Victor Stinner 8d64248c69 Issue #12363: improve siginterrupt() tests
Backport commits 968b9ff9a059 and aff0a7b0cb12 from the default branch to 3.2
branch. Extract of the changelog messages:

"The previous tests used time.sleep() to synchronize two processes. If the host
was too slow, the test could fail.

The new tests only use one process, but they use a subprocess to:

- have only one thread
- have a timeout on the blocking read (select cannot be used in the test,
select always fail with EINTR, the kernel doesn't restart it)
- not touch signal handling of the parent process"

and

"Add a basic synchronization code between the child and the parent processes:
the child writes "ready" to stdout."

I replaced .communicate(timeout=3.0) by an explicit waiting loop using
Popen.poll().
2011-07-01 15:24:50 +02:00
Victor Stinner 2555b0aac7 (merge 3.2) Issue #11870: Skip test_threading.test_2_join_in_forked_process()
on platforms with known OS bugs

Share the list of platforms with known OS bugs with other tests. Patch written
by Charles-François Natali.
2011-07-01 14:53:07 +02:00
Victor Stinner 26d318690f Issue #11870: Skip test_threading.test_2_join_in_forked_process() on platforms
with known OS bugs

Share the list of platforms with known OS bugs with other tests. Patch written
by Charles-François Natali.
2011-07-01 14:26:24 +02:00
Giampaolo Rodola' 210e7ca032 Issue #12442: add shutil.disk_usage() 2011-07-01 13:55:36 +02:00
Victor Stinner 59929d9877 (merge 3.2) test_os: remove now useless TemporaryFileTests testcase
TemporaryFileTests has tests for os.tempnam() and os.tmpfile(), functions
removed from Python 3.

Move fdopen() tests to the FileTests testcase to test fdopen() on a file
descriptor, not on a directory descriptor (which raises an error on Windows).
2011-07-01 13:47:03 +02:00
Victor Stinner bef7fdfc04 test_os: remove now useless TemporaryFileTests testcase
TemporaryFileTests has tests for os.tempnam() and os.tmpfile(), functions
removed from Python 3.

Move fdopen() tests to the FileTests testcase to test fdopen() on a file
descriptor, not on a directory descriptor (which raises an error on Windows).
2011-07-01 13:45:30 +02:00
Victor Stinner 4497445b3f (merge 3.2) test_os: add TemporaryFileTests to the testcase list
The testcase was never executed, it's now fixed.
2011-07-01 02:57:33 +02:00
Victor Stinner 98b3722bf7 test_os: add TemporaryFileTests to the testcase list
The testcase was never executed, it's now fixed.
2011-07-01 02:56:15 +02:00
Victor Stinner bf816223df Issue #12451: Add support.create_empty_file()
We don't need to create a temporary buffered binary or text file object just to
create an empty file.

Replace also os.fdopen(handle).close() by os.close(handle).
2011-06-30 23:25:47 +02:00
Antoine Pitrou 61600cb0c3 Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows. 2011-06-30 20:04:06 +02:00
Antoine Pitrou 71cbafbda1 Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows. 2011-06-30 20:02:54 +02:00
Giampaolo Rodola' 5de1532163 Issue 12139: ftplib - remove 'post CCC' test to fix various buildot failures due to dummy test server not properly handling SSL shutdown(), see http://bugs.python.org/msg139499 2011-06-30 18:34:41 +02:00
Victor Stinner 938f635acb Issue #12451: Open the test file in binary mode in test_bz2, the text file is
not needed.
2011-06-30 18:25:07 +02:00
Victor Stinner 2f655b73e4 (merge 3.2) Issue #12451: Open files in binary mode in some tests when the text
file is not needed.

Remove also an unused variable (blank) in test_threading.
2011-06-30 18:21:39 +02:00
Victor Stinner a6d2c769fb Issue #12451: Open files in binary mode in some tests when the text file is not
needed.

Remove also an unused variable (blank) in test_threading.
2011-06-30 18:20:11 +02:00
Victor Stinner 3909da7fca (merge 3.2) Issue #12451: The XInclude default loader of xml.etree now decodes
files from UTF-8 instead of the locale encoding if the encoding is not
specified. It now also opens XML files for the parser in binary mode instead of
the text mode to avoid encoding issues.
2011-06-30 18:11:18 +02:00
Victor Stinner eaf399e335 Issue #12451: The XInclude default loader of xml.etree now decodes files from
UTF-8 instead of the locale encoding if the encoding is not specified. It now
also opens XML files for the parser in binary mode instead of the text mode to
avoid encoding issues.
2011-06-30 18:10:14 +02:00
Victor Stinner a0b12a1ca7 (merge 3.2) Issue #12451: doctest.debug_script() doesn't create a temporary
file anymore to avoid encoding issues (it used the locale encoding, whereas
UTF-8 should be).

Remove also an unused import (warnings).
2011-06-30 17:39:17 +02:00
Victor Stinner 12b8d14991 Issue #12451: doctest.debug_script() doesn't create a temporary file anymore to
avoid encoding issues (it used the locale encoding, whereas UTF-8 should be).

Remove also an unused import (warnings).
2011-06-30 17:35:55 +02:00
Victor Stinner 319672e8a6 (merge 3.2) Issue #12451: pydoc.synopsis() now reads the encoding cookie if
available, to read the Python script from the right encoding.
2011-06-30 15:58:29 +02:00
Victor Stinner e6c910e953 Issue #12451: pydoc.synopsis() now reads the encoding cookie if available, to
read the Python script from the right encoding.
2011-06-30 15:55:43 +02:00
Victor Stinner 0b5e049ea0 (merge 3.2) Issue #12451: distutils now opens the setup script in binary mode
to read the encoding cookie, instead of opening it in UTF-8.
2011-06-30 15:41:56 +02:00
Victor Stinner dc9b1ea02e Issue #12451: distutils now opens the setup script in binary mode to read the
encoding cookie, instead of opening it in UTF-8.
2011-06-30 15:40:22 +02:00
Victor Stinner 7f86811d55 Issue #12400: test_cprofile now restores correctly the previous sys.stderr
Copy sys.stderr before replacing it, instead of using sys.__stderr__
2011-06-30 00:00:45 +02:00
Victor Stinner 7248850bee Issue #12400: test_faulthandler now uses sys.__stderr__
instead of open(os.devnull, 'w')
2011-06-29 23:24:31 +02:00
Victor Stinner e15bfeb8ce (merge 3.2) Issue #12400: regrtest.runtest() uses stream.seek(0) before .truncate()
.truncate(0) doesn't rewind.
2011-06-29 20:03:13 +02:00
Victor Stinner fcc2a21fae Issue #12400: regrtest.runtest() uses stream.seek(0) before .truncate()
.truncate(0) doesn't rewind.
2011-06-29 20:01:29 +02:00
Victor Stinner e6db1440d8 (merge 3.2) Issue #12400: test_zipimport_support doesn't restore original
sys.stdout anymore

regrtest doesn't check that a test doesn't output anything anymore.
2011-06-29 18:12:33 +02:00
Victor Stinner 592f679dce Issue #12400: test_zipimport_support doesn't restore original sys.stdout
anymore

regrtest doesn't check that a test doesn't output anything anymore.
2011-06-29 18:11:36 +02:00
Victor Stinner fa832dea2a (merge 3.2) Issue #12400: runtest() truncates the StringIO stream before a new
test
2011-06-29 17:29:22 +02:00
Victor Stinner 85b3a492d6 Issue #12400: runtest() truncates the StringIO stream before a new test 2011-06-29 17:26:38 +02:00
Victor Stinner 68416f0ae5 (merge 3.2) Issue #12400: Add missing import (os) to test_kqueue 2011-06-29 17:20:33 +02:00