Commit Graph

19343 Commits

Author SHA1 Message Date
Victor Stinner 85c6772aec IDLE: fix some RessourceWarning, reuse tokenize.open() 2011-09-02 00:57:04 +02:00
Éric Araujo 793c47a88a Merge doc changes from 3.2 (#10454, #12298) 2011-09-02 00:03:20 +02:00
Éric Araujo ae5af15e41 Minor: tweak docstrings and __all__ in packaging.tests.support 2011-09-01 23:48:13 +02:00
Victor Stinner c15c88c13d Issue #12494: Close pipes and kill process on error in subprocess functions
On error, call(), check_call(), check_output() and getstatusoutput() functions
of the subprocess module now kill the process, read its status (to avoid
zombis) and close pipes.
2011-09-01 23:45:04 +02:00
Éric Araujo 024de54fc2 Fix typo (was build) and remove redundancy in docstring 2011-09-01 23:37:56 +02:00
Charles-François Natali 3391e64482 Issue #12868: Skip test_faulthandler.test_stack_overflow() on OpenBSD:
sigaltstack(2) doesn't work when linked with pthread.
2011-09-01 23:08:21 +02:00
Éric Araujo 8dad18764d Remove obsolete comment 2011-09-01 22:06:23 +02:00
Antoine Pitrou 5edbaf295e Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
mapped to POSIX errno ENOTDIR (previously EINVAL).
2011-09-01 21:38:37 +02:00
Antoine Pitrou a762285831 Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
mapped to POSIX errno ENOTDIR (previously EINVAL).
2011-09-01 21:37:43 +02:00
Éric Araujo 3b371cfeb8 #10454: a few edits to compileall help messages 2011-09-01 20:00:33 +02:00
Éric Araujo 0ac4a5d6d2 Add missing name in shutil.__all__ 2011-09-01 08:31:51 +02:00
Éric Araujo d9299e97ab Minor improvement to extensions in setup.cfg: check parent package 2011-09-01 07:01:13 +02:00
Éric Araujo 336b4e4ff3 Minor improvement to extensions section in setup.cfg.
The right-hand part in [extension: foo] is now used as the name of the
extension module.  (I changed the separator from = to : and allowed
whitespace to make the sections look nicer.)
2011-09-01 06:29:11 +02:00
Éric Araujo 95fc53f2b3 Clean up packaging.util: add __all__, remove some unused functions.
This huge module is the heir of six distutils modules, and contains
a number of miscellaneous functions.  I have attempted to help readers
of the source code with an annoted __all__.  Removed or deprecated
functions have been removed from the documentation; I’m working on
another patch to document the remaining public functions.

For the curious:

The unzip_file and untar_file were used by (or intended to be used by)
“pysetup install path/to/archive.tar.gz”, but the code presently used
shutil.unpack_archive and an helper function, so I just deleted them.
They’re still in the repository if we need them in the future.

The find_packages function is not used anymore but I want to discuss
module and package auto-discovery (in “pysetup create”) again before
removing it.

subst_vars now lives in sysconfig; rfc822_escape is inlined in
packaging.metadata.  Other functions are for internal use only, or
deprecated; I have left them out of __all__ and sprinkled TODO notes
for future cleanups.
2011-09-01 05:11:29 +02:00
Benjamin Peterson 799bd80d8a expose linux extended file system attributes (closes #12720) 2011-08-31 22:15:17 -04:00
Éric Araujo ab3bea6815 Merge fix for #10086 from 3.2 2011-08-31 16:52:12 +02:00
Éric Araujo 48e484fdde Fix test_sysconfig when run from a Python installed under /site (#10086).
Patch by Hallvard B Furuseth.
2011-08-31 16:48:17 +02:00
Éric Araujo 5bb7345132 Fix packaging command registry to let Windows machines find bdist_msi 2011-08-31 16:12:31 +02:00
Éric Araujo cabca45f60 Branch merge 2011-08-31 15:34:34 +02:00
Amaury Forgeot d'Arc 7ec192878a Remove unused variable 2011-08-31 00:43:55 +02:00
Antoine Pitrou 2d243494c6 Try to fix one of the bigmem tests in test_pickle 2011-08-30 23:39:59 +02:00
Antoine Pitrou e897e95880 Try to fix one of the bigmem tests in test_pickle 2011-08-30 23:39:34 +02:00
Éric Araujo 3f184f56f7 Move help texts near to the function they’re related to 2011-08-30 22:23:52 +02:00
Éric Araujo 61543b1afc Fix typo I introduced in f93acf8844ec 2011-08-30 22:13:21 +02:00
Amaury Forgeot d'Arc dd2f8b0b77 Merge from 3.2:
- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to file.write()
- Issue #11241: subclasses of ctypes.Array can now be subclassed.
2011-08-30 22:07:20 +02:00
Amaury Forgeot d'Arc faecc38809 Issue #11241: subclasses of ctypes.Array can now be subclassed. 2011-08-30 22:02:51 +02:00
Amaury Forgeot d'Arc 326e189410 Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
2011-08-30 21:40:20 +02:00
Éric Araujo d9d67a6b5c Update list of trove classifiers to match PyPI 2011-08-30 19:05:46 +02:00
Antoine Pitrou 7a18d21230 Remove misleading comment and code.
Windows does set the errno attribute to ENOENT, but the error message
displays the Windows error number (3 -> ERROR_PATH_NOT_FOUND), not the
errno number (2 -> ENOENT).
The Unix errno corresponding to 3 is ESRCH, explaining the confusion,
which can be seen in the following snippet:

>>> shutil.rmtree("foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Z:\default\lib\shutil.py", line 272, in rmtree
    onerror(os.listdir, path, sys.exc_info())
  File "Z:\default\lib\shutil.py", line 270, in rmtree
    names = os.listdir(path)
WindowsError: [Error 3] The system cannot find the path specified:
'foo\\*.*'
>>> e = sys.last_value
>>> e.errno
2
>>> e.winerror
3
>>> errno.errorcode[2]
'ENOENT'

For reference, see PC/errmap.h and
http://msdn.microsoft.com/en-us/library/ms681382%28v=vs.85%29.aspx
2011-08-30 18:34:47 +02:00
Éric Araujo d15b768ddb Branch merge 2011-08-30 16:21:15 +02:00
Éric Araujo caa745e7ca Branch merge 2011-08-30 16:05:31 +02:00
Éric Araujo b9fe54cccc Make bdist_* commands respect --skip-build passed to bdist (#10946).
There was already a test for this, but it was complicated and had a
subtle bug (custom command objects need to be put in dist.command_obj so
that other command objects may see them) that rendered it moot.
2011-08-30 01:42:50 +02:00
Éric Araujo 83ab3f319b Remove obsolete mentions of the compress program and .Z archives.
Packaging uses the shutil.make_archive function copied from distutils,
which does not support compress.  There is no test to check that
“bdist --format whatever” works, so this slipped by.
2011-08-30 01:19:02 +02:00
Éric Araujo ff29ff8831 Merge fix for #10946 from 3.2 2011-08-30 01:01:45 +02:00
Éric Araujo 5e48c78ecf Remove display options (--name, etc.) from the Distribution class.
These options were used to implement “setup.py --name”,
“setup.py --version”, etc. which are now handled by the pysetup metadata
action or direct parsing of the setup.cfg file.

As a side effect, the Distribution class no longer accepts a 'url' key
in its *attrs* argument: it has to be 'home-page' to be recognized as a
valid metadata field and passed down to the dist.metadata object.

I cleaned up some comments, docstrings and code along the way.
2011-08-30 00:55:02 +02:00
Éric Araujo acddb38602 Cleanup: move code out of a try block 2011-08-30 00:45:59 +02:00
Antoine Pitrou a514eb95f3 Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
2011-08-30 00:28:40 +02:00
Antoine Pitrou 55549ec476 Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
2011-08-30 00:27:10 +02:00
Antoine Pitrou ee763e2acc Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
2011-08-29 23:14:53 +02:00
Antoine Pitrou 82be19f889 Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
2011-08-29 23:09:33 +02:00
Éric Araujo fb639295ac Print all fields when calling “pysetup metadata” without options.
When called without option (“-f field” or “--all”), “pysetup metadata”
didn’t do anything useful.  Now it prints out all metadata fields.  The
“--all” option is removed.
2011-08-29 22:03:46 +02:00
Éric Araujo fbe37dfffe Make bdist_* commands respect --skip-build passed to bdist (#10946) 2011-08-29 21:48:39 +02:00
Éric Araujo b741313ca8 Cleanup: use sys.version_info instead of convoluted hexversion lshifts 2011-08-29 21:43:48 +02:00
Antoine Pitrou 76f570a9c6 Make tests faster by reaping threads only at the end 2011-08-28 01:24:22 +02:00
Antoine Pitrou d54fa555cb Make tests faster by reaping threads only at the end 2011-08-28 01:23:52 +02:00
Antoine Pitrou a5dba1abea Provide a better diagnosis on socket errors 2011-08-28 01:22:22 +02:00
Antoine Pitrou 6b2e160d27 Provide a better diagnosis on socket errors 2011-08-28 01:20:42 +02:00
Nick Coghlan 2093730454 Fix #9923: mailcap now uses the OS path separator for the MAILCAP envvar. Not backported, since it could break cases where people worked around the old POSIX-specific behaviour on non-POSIX platforms. 2011-08-28 00:17:31 +10:00
Nick Coghlan 513886aabb Fix #12835: prevent use of the unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets (Patch by David Watson) 2011-08-28 00:00:27 +10:00
Nadeem Vawda a89c32ccd9 Merge: Make regrtest complain when -M and -j are used together.
-j doesn't pass the memlimit on to child processes, so this doesn't work at
present, and even if it did, running multiple bigmem tests at once would
usually not be desirable (since you generally want to devote as much of the
available RAM as possible to each test).
2011-08-27 15:24:23 +02:00
Nadeem Vawda c1fba3ea0c Make regrtest complain when -M and -j are used together.
-j doesn't pass the memlimit on to child processes, so this doesn't work at
present, and even if it did, running multiple bigmem tests at once would
usually not be desirable (since you generally want to devote as much of the
available RAM as possible to each test).
2011-08-27 15:22:05 +02:00
Éric Araujo 3577c3cfb8 Branch merge 2011-08-26 16:30:57 +02:00
Éric Araujo 2f24fda195 Branch merge 2011-08-26 16:30:22 +02:00
Éric Araujo 8d9dcd185c Merge from 3.2 (#9302 fix and other changes) 2011-08-26 01:17:56 +02:00
Éric Araujo 1329185890 Minor code simplification 2011-08-26 00:05:11 +02:00
Éric Araujo c686167298 Turn two ifs into one in the code I commited a few days ago 2011-08-26 00:03:22 +02:00
Antoine Pitrou bcf147cb72 Issue #12333: fix test_distutils failures under Solaris and derivatives 2011-08-25 18:32:54 +02:00
Antoine Pitrou 08e544e27b Issue #12333: fix test_distutils failures under Solaris and derivatives 2011-08-25 18:32:02 +02:00
Georg Brandl b0993bc78d Bump to 3.2.2. 2011-09-03 11:17:55 +02:00
Georg Brandl f1961e8b5f Regenerate pydoc topics. 2011-09-03 10:37:09 +02:00
Éric Araujo d5a9811dbe Make bdist_* commands respect --skip-build passed to bdist (#10946) 2011-08-29 21:48:39 +02:00
Antoine Pitrou 4fc80b62ba Issue #12333: fix test_distutils failures under Solaris and derivatives 2011-08-25 18:32:02 +02:00
Éric Araujo ced7eda717 Another (hopefully last) fix for test_packaging on Windws (#12678) 2011-08-25 18:13:58 +02:00
Antoine Pitrou 0a95b43723 Followup to cdc6c1b072a5: I forgot to "hg add" the test files 2011-08-25 15:01:15 +02:00
Antoine Pitrou 4fd1e6a3ba Issue #12803: SSLContext.load_cert_chain() now accepts a password argument
to be used if the private key is encrypted.  Patch by Adam Simpkins.
2011-08-25 14:39:44 +02:00
Charles-François Natali a045c05878 Issue #12656: Really fix test_asyncore failures on Windows buildbots... 2011-08-25 01:22:50 +02:00
Charles-François Natali e3540b47d1 Issue #12656: Fix test_asyncore failures on Windows buildbots. 2011-08-25 00:50:41 +02:00
Charles-François Natali e78cbecaf1 Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore. 2011-08-24 23:24:05 +02:00
Éric Araujo e049f470cd Fix test_packaging on Windows (#12678).
See the distutils commit message for more detail.
2011-08-24 02:15:25 +02:00
Éric Araujo 09ab4f86e8 Merge distutils bug fix from 3.2 2011-08-24 01:58:59 +02:00
Éric Araujo c3085aa77b Fix distutils tests on Windows (#12678).
- First, support.fixup_build_ext (already used to set proper
  library_dirs value under Unix shared builds) gains the ability to
  correctly set the debug attribute under Windows debug builds.

- Second, the filename for the extension module gets a _d suffix under
  debug builds.

- Third, the test code properly puts our customized build_ext object
  into an internal dictionary to make sure that the install command will
  later use our object instead of re-creating one.  That’s the downside
  of using low-level APIs in our test code: we have to manually push
  knobs and turn handles that would otherwise be handled behind the
  scenes.

Thanks to Nadeem for the testing.
2011-08-24 01:29:10 +02:00
Éric Araujo 175eb995d3 Fix distutils tests on Windows (#12678).
- First, support.fixup_build_ext (already used to set proper
  library_dirs value under Unix shared builds) gains the ability to
  correctly set the debug attribute under Windows debug builds.

- Second, the filename for the extension module gets a _d suffix under
  debug builds.

- Third, the test code properly puts our customized build_ext object
  into an internal dictionary to make sure that the install command will
  later use our object instead of re-creating one.  That’s the downside
  of using low-level APIs in our test code: we have to manually push
  knobs and turn handles that would otherwise be handled behind the
  scenes.

Thanks to Nadeem for the testing.
2011-08-24 01:29:10 +02:00
Éric Araujo 831fe48726 Branch merge 2011-08-23 21:41:03 +02:00
Éric Araujo 0fe3605cac Try to fix packaging tests using build_ext on Windows (#12678) 2011-08-23 21:38:13 +02:00
Antoine Pitrou 7a084105a0 Merge 2011-08-23 19:49:13 +02:00
Antoine Pitrou 162fee109b Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
2011-08-23 19:48:34 +02:00
Charles-François Natali 6cea35a8e3 Issue #12821: Fix test_fcntl failures on OpenBSD 5. 2011-08-23 19:46:46 +02:00
Antoine Pitrou bcb39d4846 Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
2011-08-23 19:46:22 +02:00
Antoine Pitrou 5bd8b8d80f A warning doesn't equate a failed test
(this broken -F with e.g. test_multiprocessing)
2011-08-23 19:32:26 +02:00
Nick Coghlan 5fab03fd15 Remove the SSLSocket versions of sendmsg/recvmsg due to lack of proper tests and documentation in conjunction with lack of any known use cases (see issue #6560 for details) 2011-08-23 22:26:44 +10:00
Ezio Melotti 83feff5686 #6484: refactor a bit the tests. 2011-08-23 01:39:22 +03:00
Sandro Tosi 91f948a734 #12191: fix build failures, explicitly passing group argument when I want to test it 2011-08-22 23:55:39 +02:00
Ezio Melotti a3fbde3504 Merge indentation fix and skip decorator with 3.2. 2011-08-23 00:40:09 +03:00
Ezio Melotti a5c92b4714 Fix indentation and add a skip decorator. 2011-08-23 00:37:08 +03:00
Sandro Tosi d902a14dd0 #12191: add shutil.chown() to change user and/or group owner of a given path also specifying their names. 2011-08-22 23:28:27 +02:00
Ezio Melotti 6f2a683a0c #9200: merge with 3.2. 2011-08-22 20:31:11 +03:00
Ezio Melotti 93e7afc5d9 #9200: The str.is* methods now work with strings that contain non-BMP characters even in narrow Unicode builds. 2011-08-22 14:08:38 +03:00
Nadeem Vawda 3d1706fa83 Fix deprecation warnings in test_socket. 2011-08-22 09:46:56 +02:00
Nick Coghlan c4a287114e Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs. 2011-08-22 16:19:19 +10:00
Nick Coghlan 029ba2b8cd Add unit tests for the mailcap module. Patch by Gregory Nofi (closes #6484) 2011-08-22 16:05:44 +10:00
Nick Coghlan 96fe56abec Add support for the send/recvmsg API to the socket module. Patch by David Watson and Heiko Wundram. (Closes #6560) 2011-08-22 11:55:57 +10:00
Nadeem Vawda ce9da2ffa6 Issue #12678: Fix distutils sdist test on Windows.
Patch by Jeremy Kloth.
2011-08-21 22:35:41 +02:00
Nadeem Vawda 3d3bc81219 Issue #12678: Fix distutils sdist test on Windows.
Patch by Jeremy Kloth.
2011-08-21 22:35:41 +02:00
Éric Araujo ad457d6d50 Fix test_command_install_dist in shared Python builds 2011-08-21 17:38:56 +02:00
Éric Araujo 2737222b49 Factor out the build_ext fixup for shared Python builds.
I need this to fix the failing test_command_install_dist.
2011-08-21 17:38:36 +02:00
Éric Araujo cd7c3d9d5f Remove obsolete code 2011-08-21 17:37:36 +02:00
Éric Araujo 006b485511 Merge build_ext fix from 3.2 2011-08-21 17:10:50 +02:00
Éric Araujo a031abc166 Fix distutils test_install for shared CPython builds 2011-08-21 17:03:19 +02:00
Éric Araujo 8c973189b5 Fix distutils test_install for shared CPython builds 2011-08-21 17:03:19 +02:00
Éric Araujo 6e3ad8736e Factor out the build_ext fixup for shared Python builds.
I need this to fix the failing test_install.
2011-08-21 17:02:07 +02:00
Éric Araujo c5efe65df3 Merge 3.2 2011-08-21 14:30:00 +02:00
Éric Araujo 5fa8e7a559 Add missing name in shutil 2011-08-21 14:29:18 +02:00
Éric Araujo 24d1df79ba Merge 3.2 2011-08-21 12:54:06 +02:00
Éric Araujo 52b201f0df Add missing closing paren in docstring (thanks Ezio) 2011-08-21 12:53:37 +02:00
Charles-François Natali 7b911cb621 Issue #12783: Fix test_posix failures on FreeBSD buildbots, due to
sched_setparam() returning EINVAL for processes with SCHED_OTHER scheduling
policy.
2011-08-21 12:41:43 +02:00
Victor Stinner e67474725b Issue #12326: refactor usage of sys.platform
* Use str.startswith(tuple): I didn't know this Python feature, Python rocks!
 * Replace sometimes sys.platform.startswith('linux') with
   sys.platform == 'linux'
 * sys.platform doesn't contain the major version on Cygwin on Mac OS X
   (it's just 'cygwin' and 'darwin')
2011-08-21 00:39:18 +02:00
Sandro Tosi a9931888ed #5301: merge with 3.2 2011-08-21 00:16:49 +02:00
Sandro Tosi 83f7d347d5 #5301: add image/vnd.microsoft.icon (.ico) MIME type 2011-08-21 00:16:18 +02:00
Victor Stinner ff3d9399fc Close #12326: sys.platform is now always 'linux' on Linux
On Linux, sys.platform doesn't contain the major version anymore. It is now
always 'linux', instead of 'linux2' or 'linux3' depending on the Linux version
used to build Python.
2011-08-20 23:39:26 +02:00
Éric Araujo 87f58d828a Merge 3.2 2011-08-20 20:02:04 +02:00
Éric Araujo 86333e987e Branch merge 2011-08-20 20:00:07 +02:00
Éric Araujo ff531461e0 Branch merge 2011-08-20 19:55:58 +02:00
Éric Araujo 19ffe600e9 Fix sdist test on Windows (#12678). Patch by Jeremy Kloth. 2011-08-20 19:52:07 +02:00
Antoine Pitrou e8bb1a0229 Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
2011-08-20 14:52:04 +02:00
Antoine Pitrou e05565ec5a Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
2011-08-20 14:39:23 +02:00
Antoine Pitrou 8fd544ffa9 Issue #12791: Break reference cycles early when a generator exits with an exception. 2011-08-20 14:18:25 +02:00
Antoine Pitrou a370fcf3b2 Issue #12791: Break reference cycles early when a generator exits with an exception. 2011-08-20 14:15:03 +02:00
Éric Araujo 0a733627f9 Add a simple test for the packaging RECORD file.
The existing test_record is not easily extendable to add script files or
extension modules: it collects all files from fake_dists and generates a
RECORD file at runtime.  I felt more comfortable adding a new test
written from scratch more self-contained (just one project with
well-defined files) and more stupid (the checksums and sizes are
computed once and hard-coded).
2011-08-20 09:31:25 +02:00
Éric Araujo ba9b2689be Minor cleanup
- Rename an attribute and create it in initialize_options instead of
  finalize_options to match the other install_* classes
- Remove unnecessary method call in tests
2011-08-20 09:19:25 +02:00
Éric Araujo 540edc6e66 Add a test for extension modules in the old-style record file 2011-08-20 07:42:56 +02:00
Éric Araujo 746e72d59c Rework test_old_record a bit to make the test more exact
(i.e. to check the files found are what we expect)
2011-08-20 07:34:43 +02:00
Éric Araujo 60b0d31e35 Refactor the copying of xxmodule.c in packaging tests (#12141).
I need to copy this file in another test too, so I moved the support
code to distutils.tests.support and improved it to use proper skip
machinery instead of custom print/return/test suite fiddling.

Contrary to my similar change in distutils tests, I did not add support
for finding xxmodule.c when running a test from the tests directory,
because in that case my compiler didn’t find Python.h, so I figured it’s
better to skip than to fail.
2011-08-20 07:27:47 +02:00
Éric Araujo e1e1331a49 Dedent example in docstring 2011-08-20 07:25:39 +02:00
Éric Araujo c9322aabaa Merge 3.2 2011-08-20 07:10:54 +02:00
Éric Araujo 6b32ecff20 Add a test for extension modules in the distutils record file.
I made a note a month ago that install --record wrote incorrect entries
for extension modules (I think the problem was that the first character
of the file was stripped), so I’m now adding a test to try to reproduce
that in the current versions.
2011-08-20 07:08:51 +02:00
Éric Araujo 1772541085 Add a test for extension modules in the distutils record file.
I made a note a month ago that install --record wrote incorrect entries
for extension modules (I think the problem was that the first character
of the file was stripped), so I’m now adding a test to try to reproduce
that in the current versions.
2011-08-20 07:08:51 +02:00
Éric Araujo 3c2ec8e52b Rework test_record a bit to make the test more exact 2011-08-20 07:00:41 +02:00
Éric Araujo e74e3cf1e1 Factor out the build_ext fixup for shared Python builds.
I need this to fix the failing test_install.
2011-08-21 17:02:07 +02:00
Éric Araujo 9358bfdaff Rework test_record a bit to make the test more exact 2011-08-20 07:00:41 +02:00
Éric Araujo fba5a94342 Refactor the copying of xxmodule.c in distutils tests (#12141).
I need to copy this file in another test too, so I moved the support
code to distutils.tests.support and improved it:

- don’t skip when run from the Lib/distutils/tests directory
- use proper skip machinery instead of custom print/return/test suite
  fiddling.
2011-08-20 06:27:18 +02:00
Amaury Forgeot d'Arc 4cfb42dd2d Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
2011-08-30 21:40:20 +02:00
Nadeem Vawda 0c97e5f36a Make regrtest complain when -M and -j are used together.
-j doesn't pass the memlimit on to child processes, so this doesn't work at
present, and even if it did, running multiple bigmem tests at once would
usually not be desirable (since you generally want to devote as much of the
available RAM as possible to each test).
2011-08-27 15:22:05 +02:00
Antoine Pitrou b897168eb6 A warning doesn't equate a failed test
(this broken -F with e.g. test_multiprocessing)
2011-08-23 19:32:26 +02:00
Éric Araujo 7cc1fb073d Add missing name in shutil 2011-08-21 14:29:18 +02:00
Sandro Tosi d318293295 #5301: add image/vnd.microsoft.icon (.ico) MIME type 2011-08-21 00:16:18 +02:00
Éric Araujo def15dafda Refactor the copying of xxmodule.c in distutils tests (#12141).
I need to copy this file in another test too, so I moved the support
code to distutils.tests.support and improved it:

- don’t skip when run from the Lib/distutils/tests directory
- use proper skip machinery instead of custom print/return/test suite
  fiddling.
2011-08-20 06:27:18 +02:00
Antoine Pitrou 107d65d144 Fix typo in test names 2011-08-19 20:33:11 +02:00
Antoine Pitrou 20db51108c Fix typo in test names 2011-08-19 20:32:34 +02:00
Antoine Pitrou df7fc9dda7 Issue #12778: Reduce memory consumption when JSON-encoding a large container of many small objects. 2011-08-19 18:03:14 +02:00
Éric Araujo 9bb6dfe0a8 Restore $HOME after test has run (should fix #12765) 2011-08-19 17:47:52 +02:00
Éric Araujo 85ce247726 Branch merge 2011-08-19 14:22:52 +02:00
Éric Araujo 57bee66c03 Branch merge 2011-08-19 14:22:28 +02:00
Vinay Sajip 444be16136 Issue #12780: Merged fix from 3.2. 2011-08-19 07:15:45 +01:00
Vinay Sajip 2da23caec0 Issue #12780: Removed checks in logging for .pyc/.pyo in __file__. 2011-08-19 07:14:40 +01:00
Nadeem Vawda 74adbaa7bd Merge: Fix ResourceWarnings in test_subprocess. 2011-08-19 05:14:40 +02:00
Nadeem Vawda 0d7cda3e63 Fix ResourceWarnings in test_subprocess. 2011-08-19 05:12:01 +02:00
Éric Araujo 24d6cc6f4f Merge 3.2 2011-08-19 03:19:36 +02:00
Éric Araujo 43a7ee1f3b Make logging call lazy 2011-08-19 02:55:11 +02:00
Éric Araujo 50e516aa8e Improve “pysetup create” help messages.
The example version numbers were invalid and “package” was misused.  I
also made lines shorter, replaced “e-mail” with “email” (more common in
the stdlib and I believe in English generally) and tweaked a few other
things.
2011-08-19 00:56:57 +02:00
Éric Araujo b931ab4345 Fix typo 2011-08-19 00:53:20 +02:00
Éric Araujo 55b9fe232d Remove class that was only useful with Sphinx autodoc 2011-08-19 00:53:04 +02:00
Charles-François Natali 2736c5d47c Issue #12650: fix failures on some buildbots, when a subprocess takes a long
time to spawn.
2011-08-19 00:25:07 +02:00
Charles-François Natali 72d161af51 Issue #12650: fix failures on some buildbots, when a subprocess takes a long
time to spawn.
2011-08-19 00:24:00 +02:00
Charles-François Natali 558639f0c9 Issue #12650: Fix a race condition where a subprocess.Popen could leak
resources (FD/zombie) when killed at the wrong time.
2011-08-18 19:11:29 +02:00
Charles-François Natali 134a8baed9 Issue #12650: Fix a race condition where a subprocess.Popen could leak
resources (FD/zombie) when killed at the wrong time.
2011-08-18 18:49:39 +02:00
Victor Stinner 9c3de4a883 Issue #12326: don't test the major version of sys.platform
Use startswith, instead of ==, when testing sys.platform to support
new platforms like Linux 3 or OpenBSD 5.
2011-08-17 20:49:41 +02:00
Benjamin Peterson 01fc6cd056 make __doc__ mutable on heaptypes (closes #12773) 2011-08-17 12:03:47 -05:00
Benjamin Peterson af3dcd2f98 improve test name 2011-08-17 11:48:23 -05:00
Benjamin Peterson c4085c8470 complain when a class variable shadows a name in __slots__ (closes #12766) 2011-08-16 18:53:26 -05:00
Benjamin Peterson 51be6e0a0f merge heads 2011-08-16 17:46:44 -05:00
Benjamin Peterson ae6ae025d1 some *nixes decided not to call init process 1 (closes #12763) 2011-08-16 17:46:04 -05:00
Ezio Melotti 67321cc9b0 #9723: refactor regex. 2011-08-16 19:03:41 +03:00
Ezio Melotti 269e3ee3db #12266: merge with 3.2. 2011-08-15 09:26:28 +03:00
Ezio Melotti ee8d998ecf #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. 2011-08-15 09:09:57 +03:00
Antoine Pitrou 85674936c7 Monotonic, not monotonous 2011-08-14 01:51:52 +02:00
Antoine Pitrou 3c7e928098 Issue #12744: Fix inefficient representation of integers
between 2**31 and 2**63 on systems with a 64-bit C "long".
2011-08-13 20:15:19 +02:00
Nadeem Vawda 780199e6a3 Issue #12669: Fix test_curses so that it can run on the buildbots. 2011-08-13 15:43:49 +02:00
Nadeem Vawda 1c38546e49 Issue #12646: Add an 'eof' attribute to zlib.Decompress.
This will make it easier to detect truncated input streams.

Also, make zlib's error messages more consistent.
2011-08-13 15:22:40 +02:00
Georg Brandl d88e5af061 Merge with cpython. 2011-08-13 11:54:33 +02:00
Georg Brandl 74b6abf61f Merge with 3.2. 2011-08-13 11:48:40 +02:00
Georg Brandl 3abb372c81 Fix #11513: wrong exception handling for the case that GzipFile itself raises an IOError. 2011-08-13 11:48:12 +02:00
Georg Brandl b3f0ce4d1e Bump version to 3.2.2rc1. 2011-08-13 11:34:58 +02:00
Georg Brandl 1db1d14e11 Update pydoc topics and suspicious ignore. 2011-08-13 11:33:35 +02:00
Benjamin Peterson 3672c4e21f merge 3.2 2011-08-13 00:33:29 -05:00
Benjamin Peterson 963e40256a tokenize is just broken on test_pep3131.py 2011-08-13 00:33:21 -05:00
Benjamin Peterson 478267f9c4 merge 3.2 2011-08-12 23:35:46 -05:00
Benjamin Peterson be66287e20 normalization is different between unicode builds, so use a new non-BMP char and add normalization test 2011-08-12 23:35:34 -05:00
Benjamin Peterson f8e7543df9 merge 3.2 (#12732) 2011-08-12 22:18:19 -05:00
Benjamin Peterson f413b80806 in narrow builds, make sure to test codepoints as identifier characters (closes #12732)
This fixes the use of Unicode identifiers outside the BMP in narrow builds.
2011-08-12 22:17:18 -05:00
Éric Araujo a7e33a10ae Clean up test_shutil, to facilitate upcoming improvements (#12721).
The tests now have two convenience functions to wrap os.path.join, open
and read or write instead of four or six slightly different functions.
The new functions accept a tuple of path segments but not a list
anymore, as it makes no sense to use a list here; I have also removed
the default value for the contents in write_file, as I find it better to
have the contents at the call site.

For simple open then read/write calls, I have left the usual idiom (with
open + read/write), as it is short and readable enough.

I’ve also changed some convoluted cleanup code to just use rmtree, and
removed dubious LBYL os.path.exists checks.  The tests still pass on my
machine, and leave no file in $TMP.  test_shutil is not as clean as it
could be, but I’ll stop here.

Initial patch provided by Hynek Schlawack, in preparation for a new
feature with new tests in #12715.
2011-08-12 19:51:35 +02:00
Éric Araujo 14eba5fa41 Brench merge 2011-08-12 17:59:25 +02:00
Éric Araujo 28d39a0c08 Branch merge 2011-08-12 17:40:25 +02:00
Éric Araujo 4460abea64 Use our existing drop-in, no-op decorator instead of redefining it.
Patch by Francisco Martin Brugue.
2011-08-12 00:15:41 +02:00
Antoine Pitrou fdf4a27422 Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles. 2011-08-11 21:15:53 +02:00
Antoine Pitrou f6c7a8595e Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles. 2011-08-11 21:04:02 +02:00
Senthil Kumaran 5b0a4d22c5 merge from 3.2 2011-08-11 09:25:45 +08:00
Senthil Kumaran 962fed9101 Fix closes Issue10087 - fixing the output of calendar display in the html format. Patch by Chris Lambacher. Test Contributed by catherine. 2011-08-11 09:22:52 +08:00
Éric Araujo cfcc9779fc Remove unused names in except clauses 2011-08-10 20:54:33 +02:00
Éric Araujo 25785e9ca5 Revert cosmetic change.
A reminder: distutils only gets bug fixes.  Cosmetic changes, especially
in tests, are not worth the time spent, and can even make future merges
of bugfixes a bit less easy.
2011-08-10 02:46:33 +02:00
Éric Araujo 7fc0394a12 Avoid unwanted behavior change in shlex.quote (see #9723).
I simplified the quote code to use a regex instead of a loop+test when I
moved pipes.quote to shlex in 5966eeb0457d; Ezio Melotti pointed out
that my regex contained redundant parts (now removed) and allowed
non-ASCII characters (now disallowed).

I think common UNIX shells don’t quote non-ASCII characters, but there’s
no harm in doing so.  We’ll see if users request a change.
2011-08-09 23:18:06 +02:00
Benjamin Peterson 71ce8970cf fix indentation 2011-08-09 16:17:12 -05:00
Benjamin Peterson e451ec393f merge heads 2011-08-09 16:16:33 -05:00
Benjamin Peterson 832bfe2ebd add a AST validator (closes #12575) 2011-08-09 16:15:04 -05:00
Éric Araujo ef1e94a848 Test pipes.quote with a few non-ASCII characters (see #9723).
That pipes.quote thinks all non-ASCII characters need to be quoted may
be a bug, but right now I’m committing this test to make sure I haven’t
introduced a behavior change in 3.3 when I simplified the code to use a
regex (in 5966eeb0457d).
2011-08-09 23:03:43 +02:00
Raymond Hettinger fcb393c018 Add support for unary plus and unary minus to collections.Counter() 2011-08-09 13:00:40 -07:00
Éric Araujo 19272beec9 Branch merge 2011-08-09 18:01:52 +02:00
Victor Stinner a8db378434 Issue #12700: fix test_faulthandler for Mac OS X Lion
Read from NULL raises SIGILL, not SIGSEGV, on Mac OS X Lion.
2011-08-08 22:43:45 +02:00
Éric Araujo 5c3f648c0c Branch merge 2011-08-08 16:56:17 +02:00
Éric Araujo e4d5b8e646 Clean up shutil.disk_usage.
- Move a test from call time to define time
- Add the function name to __all__
- Improve docstring and docs

A few lines are now duplicated (named tuple definition and docstring)
but I think the end result reads better.
2011-08-08 16:51:11 +02:00
Sandro Tosi c42a568cd4 #12677: merge with 3.2 2011-08-07 17:13:13 +02:00
Sandro Tosi 2a389e4601 #12677: correct turtle orientation in doc 2011-08-07 17:12:19 +02:00
Senthil Kumaran 0c8108914e merge from 3.2 - Fix closes issue12698 - make the no_proxy environment variable handling a bit lenient (accomodate spaces in between the items) 2011-08-06 12:28:16 +08:00
Senthil Kumaran 89976f1cdc Fix closes issue12698 - make the no_proxy environment variable handling a bit lenient (accomodate spaces in between the items) 2011-08-06 12:27:40 +08:00
Sandro Tosi 4dc9c84ed9 #11572: improvements to copy module tests along with removal of old test suite 2011-08-05 23:05:35 +02:00
Éric Araujo 29f6297605 Fix wrong use of root logger in packaging (also a NameError) 2011-08-04 17:17:07 +02:00
Ned Deily 2ef905d449 Issue #12540: Prevent zombie IDLE processes on Windows due to changes
in os.kill().  Original patch by Eli Bendersky.
2011-08-04 23:38:19 -07:00
Brett Cannon 252365bab8 Silence the altered state warning about threadgs when running test_httplib. 2011-08-04 22:43:11 -07:00
Brett Cannon 40ccea7e1e Silence altered execution state warnings from test_telnetlib involving threads. 2011-08-04 22:37:55 -07:00
Brett Cannon a4265546f9 Explicitly close a file to stop raising a ResourceWarning. 2011-08-04 21:34:52 -07:00
Senthil Kumaran 12fe95351b merge from 3.2 - change the extra svn to svn+ssh 2011-08-03 22:09:51 +08:00
Senthil Kumaran 7ce71f6496 change the redundant svn scheme urljoin test case to svn+ssh scheme. 2011-08-03 22:08:46 +08:00
Senthil Kumaran 56ee6d1820 merged heads 2011-08-03 18:46:24 +08:00
Senthil Kumaran 8283a622fc merge heads 2011-08-03 18:45:02 +08:00
Senthil Kumaran 8a984b58b7 merge from 3.2 - Fix closes issue12683 - urljoin to work with relative join of svn scheme. 2011-08-03 18:44:10 +08:00
Senthil Kumaran 2a157d2a3d Fix closes issue12683 - urljoin to work with relative join of svn scheme. 2011-08-03 18:37:22 +08:00
Georg Brandl 83fad3e2ce Merge with 3.2. 2011-08-03 08:29:12 +02:00
Georg Brandl 25e2cd1388 Fix spacing in string literal. 2011-08-03 08:27:00 +02:00
Benjamin Peterson 43234ab685 handle sched_rr_get_interval not working on current 2011-08-02 22:19:14 -05:00
Benjamin Peterson 50ba271dbb fix punctuation 2011-08-02 22:15:40 -05:00
Benjamin Peterson c158158086 fix indentation 2011-08-02 22:10:55 -05:00
Benjamin Peterson b0fc9c4d0a merge heads 2011-08-02 22:09:56 -05:00
Benjamin Peterson 539b6c41ff OSX doesn't check sched_get_priority_(min/max) argument 2011-08-02 22:09:37 -05:00
Eli Bendersky 2b6ee28630 Issue #11049: fix test_forget on installed Python - add os.curdir to sys.path 2011-08-03 05:18:33 +03:00
Ned Deily e5cad23a92 Issue #12540: Prevent zombie IDLE processes on Windows due to changes
in os.kill().  Original patch by Eli Bendersky.
2011-08-02 18:47:13 -07:00
Benjamin Peterson 18592ca589 bsd doesn't like letting normal processes set the scheduler 2011-08-02 18:48:59 -05:00
Benjamin Peterson c5fce4ded2 check individually for some for sched_ functions 2011-08-02 18:07:32 -05:00
Benjamin Peterson 2740af8cc4 sched.h can exist without sched affinity support 2011-08-02 17:41:34 -05:00
Benjamin Peterson 94b580d423 expose sched.h functions (closes #12655) 2011-08-02 17:30:04 -05:00
Benjamin Peterson 7761b951db add ThreadError to threading.__all__ (closes #12679) 2011-08-02 13:05:47 -05:00
Senthil Kumaran d61535d50b Fix closes Issue12676 - Invalid identifier used in TypeError message in http.client.
Reported by Popa Claudiu and Patch by Santoso Wijaya.
2011-08-02 18:34:53 +08:00
Senthil Kumaran eb71ad4c71 Fix closes Issue12676 - Invalid identifier used in TypeError message in http.client.
Reported by Popa Claudiu and Patch by Santoso Wijaya.
2011-08-02 18:33:41 +08:00
Eli Bendersky 8db645f722 Issue #11049: fix test_forget to work on installed Python, by using a temporary module for import/forget 2011-08-02 06:24:31 +03:00
Stefan Krah d9c665b60e Merge 68b5f87566fb 2011-08-02 01:12:16 +02:00
Stefan Krah f187a0230b Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.
See: https://bugzilla.redhat.com/show_bug.cgi?id=726536
2011-08-02 01:06:16 +02:00
Nadeem Vawda 3c01d16ed9 Issue #11651: Move options for running tests into a Python script.
This will be particularly useful to Windows users.

run_tests.py originally written by Brett Cannon.
2011-08-01 23:48:26 +02:00
Éric Araujo eec1ed8119 Merge #12295 fix from 3.2 2011-08-01 17:31:12 +02:00
Éric Araujo ccf03a1cdc Fix resource warning when looking at turtledemo’s help (#12295) 2011-08-01 17:29:36 +02:00
Éric Araujo cee6bb5499 Fix bug I unwittingly added in 1521d9837d16 (found by Ezio Melotti) 2011-08-01 15:29:07 +02:00
Éric Araujo 7dfdac0b5a Branch merge 2011-08-01 14:44:17 +02:00
Éric Araujo 2ffea0e8d7 Branch merge 2011-08-01 14:43:45 +02:00
Éric Araujo b85b966de6 Stop trying to write into the stdlib during packaging tests (#12331).
This prevents tests from failing when run from a Python installed in a
read-only directory.  The code is a bit uglier; shutil.copytree calls
copystat on directories behind our back, so I had to add an os.walk
with os.chmod (*and* os.path.join!) calls.  shutil, I am disappoint.

This changeset is dedicated to the hundreds of neurons that were lost
while I was debugging this on an otherwise fine afternoon.
2011-07-31 20:47:47 +02:00
Éric Araujo ad548b8534 Merge fixes for #9860, #11104/#8688 and #12331 from 3.2 2011-07-31 18:33:00 +02:00
Éric Araujo 548c054fb7 Stop trying to write into the stdlib during lib2to3 tests (#12331).
This prevents tests from failing when run from a Python installed in a
read-only directory.
2011-07-31 17:58:46 +02:00
Senthil Kumaran 2f7c695b97 using support.transient_internet helper method in the urllib2net test. 2011-07-31 11:46:24 +08:00
Senthil Kumaran e324c57367 using support.transient_internet helper method in the urllib2net test. 2011-07-31 11:45:14 +08:00
Éric Araujo ab7c1b3f11 Fix regression with distutils MANIFEST handing (#11104, #8688).
The changed behavior of sdist in 3.1 broke packaging for projects that
wanted to use a manually-maintained MANIFEST file (instead of having a
MANIFEST.in template and letting distutils generate the MANIFEST).

The fixes that were committed for #8688 (76643c286b9f by Tarek and
d54da9248ed9 by me) did not fix all issues exposed in the bug report,
and also added one problem: the MANIFEST file format gained comments,
but the read_manifest method was not updated to handle (i.e. ignore)
them.  This changeset should fix everything; the tests have been
expanded and I successfully tested the 2.7 version with Mercurial, which
suffered from this regression.

I have grouped the versionchanged directives for these bugs in one place
and added micro version numbers to help users know the quirks of the
exact version they’re using.

Initial report, thorough diagnosis and patch by John Dennis, further
work on the patch by Stephen Thorne, and a few edits and additions by
me.
2011-07-31 04:06:12 +02:00
Senthil Kumaran b351a48eee Addressing the review comments by Antoine Pitrou for smtplib.py and test_smtplib.py. Review comments by Ezio Melotti for smtplib.rst 2011-07-31 09:14:17 +08:00
Nadeem Vawda 3fc5868a1d test_smtpnet: Skip STARTTLS test if the server doesn't support it.
This issue can arise with ISPs that redirect all connections on port 25 to
their own (crappy) mail servers.
2011-07-30 23:46:54 +02:00
Senthil Kumaran 193cd2fb26 merge heads. 2011-07-30 10:57:28 +08:00
Senthil Kumaran 3d23fd6493 Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which adds the ability to bind to specific source address on a machine with multiple interfaces. Patch by Paulo Scardine. 2011-07-30 10:56:50 +08:00