Commit Graph

21389 Commits

Author SHA1 Message Date
Georg Brandl 87903c14bc Merge with 3.2. 2012-06-24 20:07:40 +02:00
Georg Brandl 26af3b223f Refer test_xmlrpc_net to the new buildbot URL at buildbot.python.org. 2012-06-24 20:06:54 +02:00
Georg Brandl 496660c56b Partial backport of 612f34e31270: fix spacing error in exception message. 2012-06-24 20:01:05 +02:00
Georg Brandl fcbdbf22e3 urllib.request: fix spacing errors in exception/warning messages. 2012-06-24 19:56:31 +02:00
Éric Araujo 56261cff16 Branch merge 2012-06-24 13:54:22 -04:00
Éric Araujo aa789ace66 Restore test that was using pysetup and can now (#15157) use pydoc 2012-06-24 13:51:22 -04:00
Georg Brandl 19c4e5bb39 Fix test__locale on Mac; platform.uname() does not have a structseq-type interface (yet). 2012-06-24 19:29:49 +02:00
Georg Brandl c645c6ada1 Closes #15162: the meaning of "online" has shifted a bit in recent years, use "interactive" instead. 2012-06-24 17:24:26 +02:00
Antoine Pitrou 1f5d2a087c Fix test to really run behind a NNTP virus checker 2012-06-24 16:28:18 +02:00
Hynek Schlawack cf343532a2 Remove debug output from test_shutil 2012-06-24 16:21:22 +02:00
Christian Heimes 6cea65555c Issue #15061: Re-implemented hmac.compare_digest() in C 2012-06-24 13:48:32 +02:00
Larry Hastings 605a62ddb1 Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes
(structseq objects).
2012-06-24 04:33:36 -07:00
Georg Brandl 306336bcda Closes #15161: add support for giving path as a fd for truncate() and pathconf(). 2012-06-24 12:55:33 +02:00
Mark Dickinson 95aeae01e2 In random's test_seedargs: Make sure to include at least one seed object with a negative hash. 2012-06-24 11:05:30 +01:00
Vinay Sajip 6aed5fe532 Closes #15157: pydoc script added to venvs. 2012-06-24 10:35:40 +01:00
R David Murray 97f43c019f #15160: Extend the new email parser to handle MIME headers.
This code passes all the same tests that the existing RFC mime header
parser passes, plus a bunch of additional ones.

There are a couple of commented out tests where there are issues with the
folding.  The folding doesn't normally get invoked for headers parsed from
source, and the cases are marginal anyway (headers with invalid binary data)
so I'm not worried about them, but will fix them after the beta.

There are things that can be done to make this API even more convenient, but I
think this is a solid foundation worth having.  And the parser is a full RFC
parser, so it handles cases that the current parser doesn't.  (There are also
probably cases where it fails when the current parser doesn't, but I haven't
found them yet ;)

Oh, yeah, and there are some really ugly bits in the parser for handling some
'postel' cases that are unfortunately common.

I hope/plan to to eventually refactor a lot of the code in the parser which
should reduce the line count...but there is no escaping the fact that the
error recovery is welter of special cases.
2012-06-24 05:03:27 -04:00
Hynek Schlawack f841e42a98 Fix whitespace 2012-06-24 09:51:46 +02:00
Éric Araujo ec177c14d3 Packaging removal: also revert introduction of sysconfig.cfg.
We need a discussion to define what should be customized how; this new
config file is premature.  It was added to serve the needs of the
resources system in install_data / packaging.database, so it can be
removed alongside packaging for 3.3.
2012-06-24 03:27:43 -04:00
Gregory P. Smith 853ef47522 merge heads 2012-06-24 00:24:31 -07:00
Gregory P. Smith 990a5feba7 Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
2012-06-24 00:23:47 -07:00
Gregory P. Smith 5135992164 Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
2012-06-23 23:55:39 -07:00
Gregory P. Smith 8150492f11 Speed up test_io by >2x by reducing the sleep time using setitimer instead of
alarm for the signal tests.
2012-06-23 23:46:37 -07:00
Éric Araujo 859aad6a36 Remove packaging from the standard library.
Distutils2 will live on on PyPI and be included in the stdlib when it
is ready.  See discussion starting at
http://mail.python.org/pipermail/python-dev/2012-June/120430.html
2012-06-24 00:07:41 -04:00
Ezio Melotti dc44f55cc9 #11113: add a new "html5" dictionary containing the named character references defined by the HTML5 standard and the equivalent Unicode character(s) to the html.entities module. 2012-06-24 04:37:41 +02:00
Larry Hastings b698d8e7e9 Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
parameter from os.remove / os.unlink.
Patch written by Georg Brandl.  (I'm really looking forward to George
getting commit privileges so I don't have to keep doing checkins on his
behalf.)
2012-06-23 16:55:07 -07:00
Antoine Pitrou b7eb563a2a Errors in "client" methods in test_socket were ignored because of a bogus except clause.
(this could reveal test failures!)
2012-06-24 01:34:13 +02:00
Ned Deily cbfb9a56e6 Issue #13590: Improve support for OS X Xcode 4:
- Try to avoid building Python or extension modules with problematic
  llvm-gcc compiler.
- Since Xcode 4 removes ppc support, extension module builds now
  check for ppc compiler support and automatically remove ppc and
  ppc64 archs when not available.
- Since Xcode 4 no longer install SDKs in default locations,
  extension module builds now revert to using installed headers
  and libs if the SDK used to build the interpreter is not
  available.
- Update ./configure to use better defaults for universal builds;
  in particular, --enable-universalsdk=yes uses the Xcode default
  SDK and --with-universal-archs now defaults to "intel" if ppc
  not available.
2012-06-23 16:02:19 -07:00
Philip Jenvey 88bc0d2640 small refactor and PEP8 line width/docstring 2012-06-23 15:54:38 -07:00
Antoine Pitrou 110ee34e41 Lower test-skipping threshold in test_reprlib 2012-06-23 22:55:58 +02:00
Antoine Pitrou 4f6e3f74fc Avoid depending on directory iteration order in test_shutil 2012-06-23 22:05:11 +02:00
Antoine Pitrou f3a166d799 Add debug output to test_shutil 2012-06-23 21:32:36 +02:00
Antoine Pitrou 2f8a75c7a7 Proper cleanup in test_shutil, even in case of error. 2012-06-23 21:28:15 +02:00
Hynek Schlawack 2100b42317 #4489: Fix usage of fd-based functions to new api introduced earlier today
Also add an explicit test for safe implementation usage on supported platforms.

As a side effect, this commit adds a module-level attribute 'rmtree_is_safe'
which offers introspection whether the current rmtree implementation is safe
against symlink attacks.
2012-06-23 20:28:32 +02:00
Nick Coghlan 6c6e2545cb Properly test the various builtins lookup cases in inspect.getclosurevars 2012-06-23 20:07:39 +10:00
Hynek Schlawack 67be92bed4 #4489: Add a shutil.rmtree that isn't suspectible to symlink attacks
It is used automatically on platforms supporting the necessary os.openat() and
os.unlinkat() functions. Main code by Martin von Löwis.
2012-06-23 17:58:42 +02:00
Antoine Pitrou 46cb1ef457 Use non-deprecated speling. 2012-06-23 18:11:59 +02:00
Antoine Pitrou d4daa87129 Properly cleanup pep3147 modules in test_import 2012-06-23 18:09:55 +02:00
Antoine Pitrou 06e37587ff Try to further debug occasional buildbot failure 2012-06-23 17:27:56 +02:00
Antoine Pitrou 78157b3f6f On behalf of Nadeem Vawda: issue #10376: micro-optimize reading from a Zipfile.
(patch by Serhiy)
2012-06-23 16:44:48 +02:00
Ezio Melotti 3861d8b271 #15114: the strict mode of HTMLParser and the HTMLParseError exception are deprecated now that the parser is able to parse invalid markup. 2012-06-23 15:27:51 +02:00
Antoine Pitrou 463badf06c Issue #3665: \u and \U escapes are now supported in unicode regular expressions.
Patch by Serhiy Storchaka.
2012-06-23 13:29:19 +02:00
Nick Coghlan 04e2e3f231 Close #15153: Added inspect.getgeneratorlocals to simplify whitebox testing of generator state updates 2012-06-23 19:52:05 +10:00
Nick Coghlan 2f92e54507 Close #13062: Add inspect.getclosurevars to simplify testing stateful closures 2012-06-23 19:39:55 +10:00
Mark Dickinson be4fb69201 Issue #14742: test_unparse now only checks a limited number of files unless the 'cpu' resource is specified. 2012-06-23 09:27:47 +01:00
Brian Curtin dc00f1eba0 Fix #15148. Capitalize PATH, hopefully leading to less confusion 2012-06-22 22:49:12 -05:00
Brian Curtin 2193536e79 Fix #15148. Make the shutil.which docstring more thorough 2012-06-22 22:48:06 -05:00
Larry Hastings dbbc0c8bb3 Issue #14626: Fix buildbot issue on OpenIndiana 3.x machines. (Hopefully.) 2012-06-22 19:50:21 -07:00
Brian Curtin e3f3940fc3 file was the old arg name from an earlier patch. command matches the implementation 2012-06-22 21:14:34 -05:00
Alexander Belopolsky de74de5d5d Issue #15148: Fixed typos in shutil.which() docstring 2012-06-22 21:56:42 -04:00
Alexander Belopolsky 648921371e fixed whitespace 2012-06-22 21:10:50 -04:00
Alexander Belopolsky 8141cc7f88 Issues #11024: Fixes and additional tests for Time2Internaldate. 2012-06-22 21:03:39 -04:00
Jesus Cea 60c13ddd9b Skip the test only if neccesary - Kernel bug in freebsd9 - #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-23 02:58:14 +02:00
Jesus Cea 9d874866f7 Kernel bug in freebsd9 - #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-23 02:55:36 +02:00
Antoine Pitrou 310f95b04d A better repr() for FileFinder 2012-06-23 02:12:56 +02:00
Larry Hastings 90867a5aba Issue #14626: Fix buildbot issues on FreeBSD (AMD64). (Fingers crossed.) 2012-06-22 17:01:41 -07:00
Larry Hastings 9cf065cfdc Issue #14626: Large refactoring of functions / parameters in the os module.
Many functions now support "dir_fd" and "follow_symlinks" parameters;
some also support accepting an open file descriptor in place of of a path
string.  Added os.support_* collections as LBYL helpers.  Removed many
functions only previously seen in 3.3 alpha releases (often starting with
"f" or "l", or ending with "at").  Originally suggested by Serhiy Storchaka;
implemented by Larry Hastings.
2012-06-22 16:30:09 -07:00
Antoine Pitrou f0f4742b49 Fix silly mistake in debugging code 2012-06-23 00:49:44 +02:00
Larry Hastings 7c7cbfc00f Issue #15008: Implement PEP 362 "Signature Objects".
Patch by Yury Selivanov.
2012-06-22 15:19:35 -07:00
Guido van Rossum 8e0d25504c Merge 2012-06-22 15:18:38 -07:00
Guido van Rossum 95c1c48fd6 Speed up base64.urlsafe_{en,de}code(). 2012-06-22 15:16:09 -07:00
Antoine Pitrou 541b7c89ff Add debug output for temporary buildbot failures 2012-06-23 00:07:38 +02:00
Antoine Pitrou 07c24d13ed Issue #444582: shutil.which() respects relative paths. 2012-06-22 23:33:05 +02:00
Brian Curtin 849349de05 whitespace normalize 2012-06-22 16:03:06 -05:00
Brian Curtin c57a34577c Fix #444582. Add shutil.which function for finding programs on the system path. 2012-06-22 16:00:30 -05:00
Alexander Belopolsky 7e3e496abb merge 2012-06-22 16:09:42 -04:00
Alexander Belopolsky 93c9cd07b6 Issue #9527: tm_gmtoff has 'correct' sign. 2012-06-22 16:04:19 -04:00
Larry Hastings 48ed36026b Issue #14769: Incorporated mildly pedantic feedback from python-dev.
Mostly documentation changes; the code changes are clarifications,
not semantic changes.
2012-06-22 12:58:36 -07:00
Antoine Pitrou 5f6213be2d Merge 2012-06-22 21:13:34 +02:00
Antoine Pitrou 3b36fb1f53 Issue #14837: SSL errors now have `library` and `reason` attributes describing precisely what happened and in which OpenSSL submodule.
The str() of a SSLError is also enhanced accordingly.

NOTE: this commit creates a reference leak.  The leak seems tied to the
use of PyType_FromSpec() to create the SSLError type.  The leak is on the
type object when it is instantiated:

>>> e = ssl.SSLError()
>>> sys.getrefcount(ssl.SSLError)
35
>>> e = ssl.SSLError()
>>> sys.getrefcount(ssl.SSLError)
36
>>> e = ssl.SSLError()
>>> sys.getrefcount(ssl.SSLError)
37
2012-06-22 21:11:52 +02:00
David Malcolm 49526f48fc Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues 2012-06-22 14:55:41 -04:00
Jesus Cea 9436361e4c Closes #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-22 18:32:07 +02:00
Alexander Belopolsky ff493c9c46 Issue #9527: datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
2012-06-22 12:25:57 -04:00
Alexander Belopolsky fdc860f310 Issue #9527: datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
2012-06-22 12:23:23 -04:00
Larry Hastings 8f904daee9 Issue #14769: test_capi now has SkipitemTest, which cleverly checks
for "parity" between PyArg_ParseTuple() and the Python/getargs.c static
function skipitem() for all possible "format units".
2012-06-22 03:56:29 -07:00
Alexander Belopolsky 76935b9c8c Issue #14653: email.utils.mktime_tz() no longer relies on system
mktime() when timezone offest is supplied.
2012-06-21 20:48:23 -04:00
Alexander Belopolsky a07548e97b Issue #14653: email.utils.mktime_tz() no longer relies on system
mktime() when timezone offest is supplied.
2012-06-21 20:34:09 -04:00
Nadeem Vawda cf5e1d82e3 Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support). 2012-06-22 00:35:57 +02:00
Nadeem Vawda a425c3d5a2 Make lzma.{encode,decode}_filter_properties private.
These functions were originally added to support LZMA compression in the zipfile
module, and are not of interest for the majority of users.

They can be made public in 3.4 if there is user interest, but in the meanwhile,
I've opted to present a smaller, simpler API for the module's initial release.
2012-06-21 23:36:48 +02:00
Hynek Schlawack 69168354c2 #10053: Don't close FDs when FileIO.__init__ fails
Loosely based on the work by Hirokazu Yamamoto.
2012-06-21 20:58:31 +02:00
Hynek Schlawack 9ed8b4e4ca #10053: Don't close FDs when FileIO.__init__ fails
Loosely based on the work by Hirokazu Yamamoto.
2012-06-21 20:20:25 +02:00
Nadeem Vawda fd8a838d58 Issue #14684: Add support for predefined compression dictionaries to the zlib module.
Original patch by Sam Rushing.
2012-06-21 02:13:12 +02:00
Jason R. Coombs 42c9b04278 Prefer assertEqual to simply assert per recommendation in issue6727.
Clarified comment on disabled code to reference issue15093.
2012-06-20 10:24:24 -04:00
Christian Heimes 0b3847de6d Issue #15096: Drop support for the ur string prefix 2012-06-20 11:17:58 +02:00
Nadeem Vawda 10c8791978 Fix GzipFile's handling of filenames given as bytes objects.
Add relevant tests for GzipFile, and also for BZ2File and LZMAFile.
2012-06-20 01:48:50 +02:00
Nadeem Vawda 103e8113e4 Fix GzipFile's handling of filenames given as bytes objects. 2012-06-20 01:35:22 +02:00
Brian Curtin 0d0a1dedbc Fix #14772: Return the destination from some shutil functions. 2012-06-18 18:41:07 -05:00
Richard Oudkerk ac38571f00 Issue #15064: Make BaseManager.__enter__() start server if necessary. 2012-06-18 21:29:30 +01:00
Richard Oudkerk d69cfe88ea Issue #15064: Implement context manager protocol for multiprocessing types 2012-06-18 17:47:52 +01:00
Richard Oudkerk 0f884273b0 Issue #15101: Make pool finalizer avoid joining current thread. 2012-06-18 16:02:49 +01:00
Richard Oudkerk f29ec4b0c8 Issue #15101: Make pool finalizer avoid joining current thread. 2012-06-18 15:54:57 +01:00
Richard Oudkerk 1375884891 Fiddle with timeouts in barrier tests 2012-06-18 14:11:10 +01:00
Antoine Pitrou d5a1a21a89 Prevent test_inspect from keeping alive a ton of frames and local variables by way of a global variable keeping a reference to a traceback.
Should fix some buildbot failures.
2012-06-17 23:18:07 +02:00
Antoine Pitrou 48114b952b Issue #14657: The frozen instance of importlib used for bootstrap is now also the module imported as importlib._bootstrap. 2012-06-17 22:33:38 +02:00
R David Murray 7636b19366 Merge: Update out of date docstring. 2012-06-17 15:27:21 -04:00
R David Murray 3ac8c780f4 Update out of date docstring. 2012-06-17 15:26:35 -04:00
Nick Coghlan 307ef8aee5 Merge from 3.2 (Ignore X-Antivirus headers in test_nntplib) 2012-06-17 21:30:35 +10:00
Nick Coghlan 14d99a1491 Ignore X-Antivirus headers in test_nntplib 2012-06-17 21:27:18 +10:00
Nick Coghlan e51e25a3bc Merge from 3.2 (Issue #15095: Use better assertions in test_imaplib) 2012-06-17 21:15:45 +10:00
Nick Coghlan e6ef462243 Issue #15095: Use better assertions in test_imaplib 2012-06-17 21:10:21 +10:00
Nick Coghlan 9aff2a7c41 Merge from 3.2 (Issue #15043: skip test_gdb if the custom hooks can't be loaded) 2012-06-17 19:16:02 +10:00
Jason R. Coombs 658dc3f746 Disable test on Unix. Causes buildbots to fail. See Issue #15091 2012-06-17 05:06:16 -04:00
Nick Coghlan be4e4b5691 Issue #15043: skip test_gdb if the custom hooks can't be loaded 2012-06-17 18:57:20 +10:00
Martin v. Löwis 1730139a51 White space normalization. 2012-06-17 10:42:02 +02:00
Martin v. Löwis bce166681c Issue #14055: Add __sizeof__ support to _elementtree. 2012-06-17 10:41:22 +02:00
Jason R. Coombs 71fde31da3 Adding test from issue6727 demonstrating that symlink import issue does not occur here in 3.3 2012-06-17 03:53:47 -04:00
Nick Coghlan d972265df8 Improve an internal ipaddress test, add a comment explaining why treating networks as containers of interfaces rather than addresses would prove confusing 2012-06-17 16:33:00 +10:00
Meador Inge 8d5c0b8c19 Issue #15054: Fix incorrect tokenization of 'b' string literals.
Patch by Serhiy Storchaka.
2012-06-16 21:49:08 -05:00
Antoine Pitrou 7e19337ebc Normalize whitespace 2012-06-16 22:50:54 +02:00
Antoine Pitrou aaefac76dd Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.
Patch by Serhiy Storchaka.
2012-06-16 22:48:21 +02:00
Eli Bendersky 6319e0fa20 Make the test more resilient to test-run order (closes #15075) 2012-06-16 06:47:44 +03:00
Victor Stinner 184252ad3f Fix "%f" format of str%args if the result is not an ASCII or latin1 string 2012-06-16 02:57:41 +02:00
Alexander Belopolsky 0831382d69 Issue #15006: Allow equality comparison between naive and aware time
or datetime objects.
2012-06-15 20:19:47 -04:00
Brett Cannon ea0b823940 Issue #14938: importlib.abc.SourceLoader.is_package() now takes the
module name into consideration when determining whether a module is a
package or not. This prevents importing a module's __init__ module
directly and having it considered a package, which can lead to
duplicate sub-modules.

Thanks to Ronan Lamy for reporting the bug.
2012-06-15 20:00:53 -04:00
Brett Cannon 0450c9ed52 Issue #13959: Add to imp.find_module() and load_module's docstrings
that they are deprecated (previous commit documented this fact in the
module docs).
2012-06-15 19:39:06 -04:00
Brett Cannon 24aa693c7e Merge 2012-06-15 19:04:29 -04:00
Alexander Belopolsky 016ef551a7 Removed redundant code 2012-06-15 18:15:25 -04:00
Richard Oudkerk 9125775aa6 Fix _TestListener.ALLOWED_TYPES and add sanity check 2012-06-15 21:53:34 +01:00
Richard Oudkerk 3049f1243e Increase timeout used when waiting for manager to shutdown cleanly
before resorting to terminate()
2012-06-15 20:08:29 +01:00
Richard Oudkerk 0f52346e76 Fix for 2d2f206d040e so that test_multiprocessing does not depend on ctypes 2012-06-15 19:18:30 +01:00
Petri Lehtinen a717d563d0 #15036: Make a repeated changes and flushes work with single-file mailboxes 2012-06-15 21:01:56 +03:00
Petri Lehtinen 02653f1b11 #15036: Make a repeated changes and flushes work with single-file mailboxes 2012-06-15 20:59:31 +03:00
Richard Oudkerk 3730a17a58 Issue #14059: Implement multiprocessing.Barrier 2012-06-15 18:26:07 +01:00
Nick Coghlan 807770ec1b Issue #15061: Don't oversell the capabilities of the new non-shortcircuiting comparison function in hmac 2012-06-15 21:14:08 +10:00
Eli Bendersky 307693a8bb Skip XincludeTest entirely instead of just ignoring failures, because it may segfault, depending on the order of running tests 2012-06-15 09:40:44 +03:00
Eli Bendersky 27cbb19ae5 Removed _SimpleElementPath and its flaky test. The test monkey-patches the module, which causes other failures and fails itself depending on the order tests are run. 2012-06-15 09:03:19 +03:00
Eli Bendersky 175fada429 mark problematic test as expected failure - investigating 2012-06-15 08:37:08 +03:00
Eli Bendersky 64d11e60f2 Replace the iter/itertext methods of Element in _elementtree with true C implementations, instead of the bootstrapped Python code. In addition to being cleaner (removing the last remains of the bootstrapping code in _elementtree), this gives a 10x performance boost for iter() on large documents.
Also reorganized the tests a bit to be more robust.
2012-06-15 07:42:50 +03:00
Richard Oudkerk 73d9a292ae Issue #13841: Make child processes exit using sys.exit() on Windows 2012-06-14 15:30:10 +01:00
Martin v. Löwis 474eb23b7f merge 3.2 2012-06-14 15:37:53 +02:00
Martin v. Löwis 993fe3f035 Issue #14937: Fix typo. Patch by Roger Serwy. 2012-06-14 15:37:21 +02:00
Alexander Belopolsky c142bba2a7 Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
in struct tm, time.struct_time objects returned by time.gmtime(),
time.localtime() and time.strptime() functions now have tm_zone and
tm_gmtoff attributes.  Original patch by Paul Boddie.
2012-06-13 22:15:26 -04:00
Victor Stinner 6222d76952 Fix test_time for adjusted/adjustable changes 2012-06-12 23:04:11 +02:00
Victor Stinner 2b89fdf7eb PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result
Fix also its value on Windows and Linux according to its documentation:
"adjustable" indicates if the clock *can be* adjusted, not if it is or was
adjusted.

In most cases, it is not possible to indicate if a clock is or was adjusted.
2012-06-12 22:46:37 +02:00
Richard Oudkerk f0604fddc3 Issue #3518: Remove references to non-existent BaseManager.from_address()
method
2012-06-11 17:56:08 +01:00
Brett Cannon 7b383c431a Make a test easier to read. 2012-06-11 11:02:36 -04:00
Nick Coghlan 4fae8cdaea Close #13857: Added textwrap.indent() function (initial patch by Ezra
Berch)
2012-06-11 23:07:51 +10:00
Brian Quinlan a26ad5a0a1 #15015: Fix accessing an non-existing attribute. 2012-06-11 12:59:07 +10:00
Michael Foord f7c4158057 Adding patch.stopall method to unittest.mock 2012-06-10 20:36:32 +01:00
Raymond Hettinger 1c2018c311 Small cleanup and optimization 2012-06-09 22:51:39 -07:00
Raymond Hettinger 80ed4d4774 Minor reformatting (wrap fat lines, etc.) and create an __main__ file 2012-06-09 18:46:45 -07:00
Michael Foord 75963643b1 Fix exception when calling reset_mock on a mock created with autospec 2012-06-09 17:31:59 +01:00
R David Murray 6e50b699ac Now that Defects are Exception subclasses, call super.
The behavior of MessageDefect is legacy behavior.  The chances anyone is
actually using the undocumented 'line' attribute is low, but it costs
little to retain backward compatibility.  Although one of the costs is
having to restore normal exception behavior in HeaderDefect.  On the
other hand, I'll probably add some specialized behavior there later.
2012-06-08 22:45:46 -04:00
Alexander Belopolsky f6f56183ee Relax datetime.timestamp() test around DST change 2012-06-08 13:00:27 -04:00
Alexander Belopolsky 0c687e5e88 Relax datetime.timestamp() test around DST change 2012-06-08 12:58:31 -04:00
Alexander Belopolsky a4415141da Issue #2736: Added datetime.timestamp() method. 2012-06-08 12:33:09 -04:00
Hynek Schlawack ed36b2e55b #14814: Remove redundant code from ipaddress.IPv6Network
The strict checks and netmask computing don't make sense if constructed with
a ALL_ONES mask based on addresses. Also fix a bug due to mis-indentation of
a return statement in the same code block.
2012-06-08 15:21:21 +02:00
Terry Jan Reedy 571ee57695 Merge from 3.2, #12510 2012-06-07 20:04:17 -04:00
Terry Jan Reedy 2a2ce4f673 Issue #12510: Revise and triple # of calltip tests, with an eye to unittest
use. Make the get_entity 'method' a module function as it did not use 'self'.
Delete buggy _find_constructor function that is not needed, at least in 3.x.
Revise get_argspec so all tests pass.  Add and fix NEWS entries.
2012-06-07 19:41:04 -04:00
Richard Oudkerk 58ba47f97b Merge fixes for #13854 and #12157. 2012-06-07 20:38:11 +01:00
Alexander Belopolsky 74482201b8 Issue #11823: disassembly now shows argument counts on calls with keyword args 2012-06-07 14:28:14 -04:00
Richard Oudkerk 29471de459 Issue #13854: Properly handle non-integer, non-string arg to SystemExit
Previously multiprocessing only expected int or str.  It also wrongly
used an exit code of 1 when the argument was a string instead of zero.
2012-06-06 19:04:57 +01:00
Richard Oudkerk e41682b994 Issue #12157: pool.map() does not handle empty iterable correctly
Initial patch by mouad
2012-06-06 19:04:57 +01:00
Richard Oudkerk 9844993cde Add test for multiprocessing.Conditon.wait() and changset 3baeb5e13dd2 2012-06-05 13:15:29 +01:00
Victor Stinner f86a5e8a93 Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
open() and io.TextIOWrapper are now calling locale.getpreferredencoding(False)
instead of locale.getpreferredencoding() in text mode if the encoding is not
specified. Don't change temporary the locale encoding using locale.setlocale(),
use the current locale encoding instead of the user preferred encoding.

Explain also in open() documentation that locale.getpreferredencoding(False) is
called if the encoding is not specified.
2012-06-05 13:43:22 +02:00
Hynek Schlawack 91c5a34613 #14814: ipaddress: refactor dup code, minor janitoring, bump coverage
- remove duplicate netmask/hostmask code
- make two ifs more pythonic
- remove packed property for networks
- some minor pep8 stuff
- Test coverage is now at 97%, the rest are mostly unreachable safeguards.
2012-06-05 11:55:58 +02:00
Victor Stinner 034d0aa217 Issue #14711: os.stat_float_times() has been deprecated. 2012-06-05 01:22:15 +02:00
Nadeem Vawda e860404eb7 Add a function lzma.open(), to match gzip.open() and bz2.open(). 2012-06-04 23:38:12 +02:00
Nadeem Vawda 6cbb20cdf6 Allow LZMAFile to accept modes with a "b" suffix. 2012-06-04 23:36:24 +02:00
Nadeem Vawda 33c34da574 Simplify usage of LZMAFile's fileobj support, like with BZ2File. 2012-06-04 23:34:07 +02:00
Nadeem Vawda af518c198e Add a function bz2.open(), to match gzip.open(). 2012-06-04 23:32:38 +02:00
Nadeem Vawda 50cb936bd0 Clarify acceptable values for BZ2File.__init__'s mode argument. 2012-06-04 23:31:22 +02:00
Nadeem Vawda aebcdba829 Make BZ2File's fileobj support easier to use.
The fileobj argument was added during the 3.3 development cycle, so this change
does not break backward compatibility with 3.2.
2012-06-04 23:31:20 +02:00
Nadeem Vawda 68721019ef Add fileobj support to gzip.open(). 2012-06-04 23:21:38 +02:00
R David Murray 05cab75d59 #8739: fix omission of DEBUGSTREAM reset in new test in test_smtpd.
This clears up an error in detected by refleak mode that showed up when
test_smtplib was run after test_smtpd in the same refleak run.
2012-06-04 15:55:51 -04:00
Richard Oudkerk bd7b5dd816 Prevent handle leak if CreateProcess() fails in multiprocessing 2012-06-04 18:59:10 +01:00
Richard Oudkerk 86eb7e97ae Fix potential NameError in multiprocessing.Condition.wait() 2012-06-04 18:59:07 +01:00
Richard Oudkerk ad06444d6c Make Finalize reserve a reference to os.getpid in case called at shutdown 2012-06-04 18:58:59 +01:00
Hynek Schlawack 454a74df23 #14814: Remove dead code from ipaddress
_BaseNetwork contained (faulty) methods for creating string representations.
I've fixed them and put them to use by eliminating identical overrides.
2012-06-04 18:14:02 +02:00
Barry Warsaw efce00c537 Whitespace normalization 2012-06-04 12:02:42 -04:00
Barry Warsaw 028b37c941 PEP 421 requires that .name be lower case. 2012-06-04 12:01:56 -04:00
Barry Warsaw c58c392da7 Trunk merge. 2012-06-04 09:41:48 -04:00
Hynek Schlawack bcd304480f #14814: Use correct comparison for IP addresses
ipaddress._BaseV4.is_unspecified() compared IP addresses using "in" which
fails.
2012-06-04 14:19:39 +02:00
Raymond Hettinger 0c9050c25d Separate key creation logic from the sequence class that memoizes its hash value. 2012-06-04 00:21:14 -07:00
Gregory P. Smith 2d7d56abf8 Revert the modification of e.strerror in 3.2 as that kind of change could
break someone's over specified test that depends on the exact error message.
2012-06-03 14:39:26 -07:00
Gregory P. Smith f0a9a9b502 Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was
not explicitly asked for.  This is no longer an exception as mkdir
cannot control if the OS sets that bit for it or not.
2012-06-03 14:35:09 -07:00
Gregory P. Smith a81c856436 Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was not
explicitly asked for.  This is no longer an exception as mkdir cannot control
if the OS sets that bit for it or not.
2012-06-03 14:30:44 -07:00
Barry Warsaw 409da157d7 Eric Snow's implementation of PEP 421.
Issue 14673: Add sys.implementation
2012-06-03 16:18:47 -04:00
R David Murray 82ffabdfa4 #2658: Add test for issue fixed by fix for #1079. 2012-06-03 12:27:07 -04:00
Martin v. Löwis f20940792d merge 3.2 2012-06-03 12:33:23 +02:00
Martin v. Löwis 9f44a66abc PEP 3131: support non-ASCII characters in auto-completion of identifiers. 2012-06-03 12:32:42 +02:00
Martin v. Löwis 97aa21b46a Do not try to insert control characters. 2012-06-03 12:26:09 +02:00
Martin v. Löwis 428d161b57 Drop unused constant. 2012-06-03 12:03:29 +02:00
Martin v. Löwis 156989aa79 Merge 3.2: issue #14937. 2012-06-03 12:00:48 +02:00
Martin v. Löwis 862d13a30f Issue #14937: Perform auto-completion of filenames in strings even for non-ASCII filenames. 2012-06-03 11:55:32 +02:00
Senthil Kumaran fe4dfd2b65 merge heads 2012-06-03 16:16:39 +08:00
Senthil Kumaran 1251fafcc5 Issue 14989: http.server --cgi option can enable the CGI http server. 2012-06-03 16:15:54 +08:00
Terry Jan Reedy a317eef897 Merge with 3.2 #12510 2012-06-03 01:06:38 -04:00
Terry Jan Reedy e606e238ab Issue 12510: Expand 2 bare excepts. Improve comments. Change deceptive name
'name' to 'expression' as the latter is what the string actually represents.
The bug in this issue was only catching NameError and AttributeError when
evaluating an expression that was not necessarily a name.
2012-06-03 00:27:54 -04:00
Brett Cannon 2b88fcf693 Issue #14987: Add a missing import statement 2012-06-02 22:28:42 -04:00
Terry Jan Reedy 361baaddcf Merge with 3.2 #10365 2012-06-02 20:24:21 -04:00
Terry Jan Reedy a948c79ad4 Issue 10365: Add and replace comments; condense defaulted attribute access.
Code patch by Roger Serwy.
2012-06-02 20:22:58 -04:00
R David Murray 07ea53cb21 #1079: Fix parsing of encoded words.
This is a behavior change: before this leading and trailing spaces were
stripped from ASCII parts, now they are preserved.  Without this fix we didn't
parse the examples in the RFC correctly, so I think breaking backward
compatibility here is justified.

Patch by Ralf Schlatterbeck.
2012-06-02 17:56:49 -04:00
Sandro Tosi e1b22edd23 Issue #14926: merge with 3.2 2012-06-02 19:40:20 +02:00
Sandro Tosi 29d09aa4dd Issue #14926: fix docstring highlight 2012-06-02 19:40:02 +02:00
Sandro Tosi b4386d36f1 Issue #14814: minor spelling fixes 2012-06-02 17:14:22 +02:00
Victor Stinner 0dec1bfef9 Fix sporadic failure of test_time.test_process_time() on Windows
Use a threshold of 20 ms instead of 10 ms.
2012-06-01 22:45:23 +02:00
Hynek Schlawack 35db513187 #14814: Fix errror message creation in ipaddress.collapse_addresses 2012-06-01 20:12:17 +02:00
Nick Coghlan 77452fc121 Close #14969: Improve the handling of exception chaining in contextlib.ExitStack 2012-06-01 22:48:32 +10:00
Hynek Schlawack c4b78a3e15 #14814: Remove 2.x's new-style classes syntax from ipaddress 2012-06-01 11:48:32 +02:00
Eli Bendersky 2b6b73e7e1 Issue #14007: implement doctype() method calling in XMLParser of _elementtree.
Includes exposing a doctype handler from expat through pyexpat.
2012-06-01 11:32:34 +03:00