Commit Graph

20984 Commits

Author SHA1 Message Date
Richard Oudkerk 7ef909cdd7 Fix for issue 14725 for 3.2 branch 2012-05-05 20:41:23 +01:00
Richard Oudkerk fdb8dcf675 Fix for Issue 14725 for 3.3 branch. 2012-05-05 19:45:37 +01:00
Lars Gustäbel 7a919e9930 Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
The ExFileObject class was removed, some of its code went into _FileInFile.
2012-05-05 18:15:03 +02:00
Benjamin Peterson ef5a4636d0 don't append the bytecode suffix to the source suffixes global 2012-05-05 09:44:08 -04:00
Brett Cannon feccc09952 Clean up a docstring. 2012-05-04 16:47:54 -04:00
Brett Cannon f19c191067 Jython-friendly tweak. 2012-05-04 15:46:04 -04:00
Brett Cannon 2657df4744 Issue #13959: Re-implement imp.get_suffixes() in Lib/imp.py.
This introduces a new function, imp.extension_suffixes(), which is
currently undocumented. That is forthcoming once issue #14657 is
resolved and how to expose file suffixes is decided.
2012-05-04 15:20:40 -04:00
Brett Cannon 17098a5447 Properly mark names in importlib._bootstrap as private. 2012-05-04 13:52:49 -04:00
Antoine Pitrou f340c21ca9 Fix test connecting to sha256.tbs-internet.com.
The certificate has changed and the test now needs SNI to pass.
2012-05-04 16:26:56 +02:00
Antoine Pitrou 16f6f8338b Fix test connecting to sha256.tbs-internet.com.
The certificate has changed and the test now needs SNI to pass.
2012-05-04 16:26:02 +02:00
Richard Oudkerk 009b15e2c3 Give test_multiprocessing better chance of avoiding timeout failures on Windows 2012-05-04 09:44:39 +01:00
Larry Hastings b14544807e Issue #14127: Fix no-op stub for platforms that lack some "os" functions. 2012-05-03 12:56:44 -07:00
Richard Oudkerk a6becaa9cb Fix dangling warning for test_multiprocessing 2012-05-03 18:29:02 +01:00
Vinay Sajip ac20f463da Merged hanged order of cleanup operations from 3.2. 2012-05-03 12:09:38 +01:00
Vinay Sajip 89282afafb Changed order of cleanup operations to be more sensible. 2012-05-03 12:06:52 +01:00
Larry Hastings 76ad59b7e8 Issue #14127: Add ns= parameter to utime, futimes, and lutimes.
Removed futimens as it is now redundant.
Changed shutil.copystat to use st_atime_ns and st_mtime_ns from os.stat
and ns= parameter to utime--it once again preserves exact metadata on Linux!
2012-05-03 00:30:07 -07:00
Charles-François Natali 598b2f6bd0 Merge. 2012-05-02 20:51:59 +02:00
Charles-François Natali 360b3c21f5 os.popen().close() returns None on success, not 0... 2012-05-02 20:50:13 +02:00
Charles-François Natali 39687ee9db os.popen().close() returns None on success, not 0... 2012-05-02 20:49:14 +02:00
Richard Oudkerk 225cb8d077 Make test_multiprocessing cleanup properly
Previously, when an error was encountered some processes would not be
stopped until atexit callbacks were run.  On Windows that was too late
to prevent a PermissionError when regrtest tried to remove the temp
directory it ran the tests in.
2012-05-02 19:36:11 +01:00
Charles-François Natali d59240de83 Issue #14698: Make test_posix more robust when the current UID doesn't have an
associated pwd entry.
2012-05-02 20:04:40 +02:00
Charles-François Natali e8a255a5a2 Issue #14698: Make test_posix more robust when the current UID doesn't have an
associated pwd entry.
2012-05-02 20:01:38 +02:00
Martin v. Löwis 67880cc962 Issue #13183: Revert 0b53b70a40a0 (reenable test on windows) 2012-05-02 07:41:22 +02:00
Senthil Kumaran bf6c19598a fix closes issue13183 - windows test failure 2012-05-02 08:01:02 +08:00
Senthil Kumaran cb172041d3 fix windows test failure - issue13183 2012-05-02 08:00:22 +08:00
Martin v. Löwis cc1c146c7a Merge sphinx changes 2012-05-01 18:15:13 +02:00
Benjamin Peterson 1c5ae55c85 don't use assertEqual for test for bool equality 2012-05-01 11:14:32 -04:00
Martin v. Löwis 7f9d181d56 Include micro version even if it is 0. 2012-05-01 16:31:18 +02:00
Benjamin Peterson 8fbd295458 merge 3.2 (#14699) 2012-05-01 09:51:46 -04:00
Benjamin Peterson 7295c6a871 fix calling the classmethod descriptor directly (closes #14699) 2012-05-01 09:51:09 -04:00
Benjamin Peterson 49a69e4d48 strip is_ prefixes on clock_info fields 2012-05-01 09:38:34 -04:00
Martin v. Löwis d099b56be7 Check extract_version when opening a zipfile. 2012-05-01 14:08:22 +02:00
Georg Brandl c9d77b2455 Add an option to timeit to use time.process_time() and mark -t and -c as deprecated. 2012-05-01 11:56:22 +02:00
Georg Brandl b613a3d458 Disable test_13183 temporarily on Windows for 3.3a3 release. 2012-05-01 09:57:34 +02:00
Georg Brandl ab0ef20663 Bump to 3.3.0a3. 2012-05-01 09:35:18 +02:00
Georg Brandl 0aca6a8235 Regenerate pydoc topics. 2012-05-01 09:26:47 +02:00
Georg Brandl 4bde9caf74 test_pdb: fix failure of test_issue13183 in debug mode, and make sure files are cleaned up. 2012-05-01 09:21:16 +02:00
Georg Brandl 5c01678174 Add missing comma in __all__ list. 2012-05-01 09:00:59 +02:00
Martin v. Löwis 2a2ce328fb Recognize unsupported feature "compressed patch data set" from zip 2.7. 2012-05-01 08:44:08 +02:00
Martin v. Löwis b3260f08cf Detect unsupported compression types. 2012-05-01 08:38:01 +02:00
Martin v. Löwis f6b16a4b50 Issue #14371: Support bzip2 in zipfile module.
Patch by Serhiy Storchaka.
2012-05-01 07:58:44 +02:00
Raymond Hettinger 9acbb6074f Move make_key() out of the decorator body. Make keys that only need to be hashed once. 2012-04-30 22:32:16 -07:00
Raymond Hettinger 018b4fbb9b Use a flag to indicate when the circular queue is fully populated and stable. 2012-04-30 20:48:55 -07:00
Senthil Kumaran 417c3848d5 issue13183 - Fix pdb skipping frames after hitting a breakpoint and running step. Patch by Xavier de Gaye 2012-05-01 10:37:11 +08:00
Senthil Kumaran 42d7081806 issue13183 - Fix pdb skipping frames after hitting a breakpoint and running step. Patch by Xavier de Gaye 2012-05-01 10:07:49 +08:00
Raymond Hettinger 34d94a2101 Handle a possible race condition 2012-04-30 14:14:28 -07:00
Richard Oudkerk 2452419921 Issue #14669: Skip multiprocessing connection pickling test on MacOSX
Passing of fds is unreliable on MacOSX, compare issues #6560 and #12958.
2012-04-30 14:48:51 +01:00
Richard Oudkerk 4460c3476d Minor fix for multiprocessing unit test
Read from socket might have returned partial message.
2012-04-30 14:48:50 +01:00
Richard Oudkerk 3e268aac3b Mark multiprocessing files with "Licensed to PSF under a Contributor Agreement"
instead of BSD licence.
2012-04-30 12:13:55 +01:00
Raymond Hettinger b6b98c093e Track the cache size directly. 2012-04-29 18:09:02 -07:00
Victor Stinner 9a8ad0c5ea Issue #14428: Remove test_process_time_threads() from test_time
The test is unstable and it's not really interesting to test exactly how
threads are handled.
2012-04-30 01:39:57 +02:00
Victor Stinner 5df72c2c27 Issue #14428: Make test_process_time_threads() less strict 2012-04-30 00:51:31 +02:00
Alexander Belopolsky 934cb18ef5 merged 2012-04-29 18:20:05 -04:00
Alexander Belopolsky b8f02b5a5f fixed test_imaplib failure on Win 2012-04-29 18:16:46 -04:00
Raymond Hettinger a6df2ee7d0 merge 2012-04-29 14:57:05 -07:00
Raymond Hettinger 9f0ab9f564 Factor out shared variables. 2012-04-29 14:55:27 -07:00
Mark Dickinson 57404891a0 Issue #14696: Merge from 3.2 2012-04-29 22:20:01 +01:00
Mark Dickinson 407b3bd89b Issue #14696: Fix parser module to understand 'nonlocal' declarations. 2012-04-29 22:18:31 +01:00
Alexander Belopolsky 53c6651a17 merge 2012-04-29 16:34:43 -04:00
Alexander Belopolsky 5a38f80f9c Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
the DST transition.  Patch by Joe Peterson.
2012-04-29 16:12:27 -04:00
Alexander Belopolsky 2420d83158 Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
the DST transition.  Patch by Joe Peterson.
2012-04-29 15:56:49 -04:00
Raymond Hettinger 678e7f3be6 Flatten the lru cache keyword args tuple for better memory utilization. 2012-04-29 12:28:02 -07:00
Brett Cannon 1182351e69 Re-indent. 2012-04-29 14:40:43 -04:00
Brett Cannon 6818832ff6 merge 2012-04-29 14:38:57 -04:00
Brett Cannon 62228dbd6c Issues #13959, 14647: Re-implement imp.reload() in Lib/imp.py.
Thanks to Eric Snow for the patch.
2012-04-29 14:38:11 -04:00
Mark Dickinson 89e6d3896a Remove untests for non-existent functionality. 2012-04-29 19:17:05 +01:00
Victor Stinner 1fc3ec91cc Issue #14428: Rewrite test_process_time_threads() test
time.process_time() is CPU time, not a number of seconds.
2012-04-29 19:46:19 +02:00
Mark Dickinson b63fd2a408 Issue #9154: Merge fix from 3.2. 2012-04-29 18:35:56 +01:00
Mark Dickinson ea7e9f9a83 Issue #9154: Fix parser module to understand function annotations. 2012-04-29 18:34:40 +01:00
Brett Cannon acf85cd131 Issue #13959: Re-implement imp.NullImporter in Lib/imp.py. 2012-04-29 12:50:03 -04:00
Mark Dickinson e383e82e04 Issue #14521: Make result of float('nan') and float('-nan') more consistent across platforms. Further, don't rely on Py_HUGE_VAL for float('inf'). 2012-04-29 15:31:56 +01:00
Ezio Melotti d68ac85e9a #14236: merge with 3.2. 2012-04-29 13:37:13 +03:00
Ezio Melotti 3899283670 #14236: fix docs for \S. 2012-04-29 13:35:55 +03:00
Senthil Kumaran 4ca008b643 issue6085 - update docs in default branch 2012-04-29 13:44:14 +08:00
Senthil Kumaran db727b4a77 Fix issue6085 - Remove the delay caused by fqdn lookup while logging in BaseHTTPRequestHandler 2012-04-29 13:41:03 +08:00
Ezio Melotti 660a949720 #14236: merge with 3.2. 2012-04-29 08:24:02 +03:00
Ezio Melotti e990092fd0 #14236: mention Unicode whitespace in \s documentation. 2012-04-29 08:23:25 +03:00
Senthil Kumaran 1aacba497b Fix Issue6085 - SimpleHTTPServer address_string to return client ip instead of client hostname 2012-04-29 12:51:54 +08:00
Senthil Kumaran 150c365430 httplib - minor update to check empty response 2012-04-29 10:40:23 +08:00
Senthil Kumaran 7e70a5c169 httplib - minor update to check empty response 2012-04-29 10:39:49 +08:00
Senthil Kumaran 889ad16e54 httplib test for early eof response. related to Issue13684 2012-04-29 10:21:26 +08:00
Senthil Kumaran 9c29f86a81 httplib test for early eof response. related to Issue13684 2012-04-29 10:20:46 +08:00
Victor Stinner fe98e2fc83 Issue #14428: Use the new time.perf_counter() and time.process_time() functions
* Replace "time.clock on windows, or time.time" with time.perf_counter()
 * profile module: only use time.process_time() instead of trying different
   functions providing the process time
 * timeit module: use time.perf_counter() by default, time.time() and
   time.clock() can still be used using --time and --clock options
 * pybench program: use time.perf_counter() by default, add support for
   the new time.process_time() and time.perf_counter() functions, but stay
   backward compatible. Use also time.get_clock_info() to display information
   of the timer.
2012-04-29 03:01:20 +02:00
Victor Stinner ec89539ccc Issue #14428, #14397: Implement the PEP 418
* Rename time.steady() to time.monotonic()
 * On Windows, time.monotonic() uses GetTickCount/GetTickCount64() instead of
   QueryPerformanceCounter()
 * time.monotonic() uses CLOCK_HIGHRES if available
 * Add time.get_clock_info(), time.perf_counter() and time.process_time()
   functions
2012-04-29 02:41:27 +02:00
Antoine Pitrou 92ff4e196b Issue #14666: stop multiprocessing's resource-sharing thread after the tests are done.
Also, block delivery of signals to that thread. Patch by Richard Oudkerk.

This will hopefully fix sporadic freezes on the FreeBSD 9.0 buildbot.
2012-04-27 23:51:03 +02:00
Brett Cannon efad00d520 Issue #14646: __import__() now sets __loader__ if need be.
importlib.util.module_for_loader also will set __loader__ along with
__package__. This is in conjunction to a forthcoming update to PEP 302
which will make these two attributes required for loaders to set.
2012-04-27 17:27:14 -04:00
Brett Cannon fea73efc9e Issue #14605: Don't error out if get_importer() returns None. 2012-04-27 15:45:15 -04:00
Brett Cannon aa93642a35 Issue #14605: Use None in sys.path_importer_cache to represent no
finder instead of using some (now non-existent) implicit finder.
2012-04-27 15:30:58 -04:00
Brett Cannon ce418b448f Issue #14605: Stop having implicit entries for sys.meta_path.
ImportWarning is raised if sys.meta_path is found to be empty.
2012-04-27 14:01:58 -04:00
Brett Cannon 3c6ea1c14d Issue #14605: Insert to the front of sys.meta_path, don't append. 2012-04-27 13:52:55 -04:00
Brett Cannon c8287efed3 Invalidate finder caches after creating a new script. 2012-04-27 13:52:03 -04:00
Jesus Cea 990eff0776 Backing out 86dc014cdd74. Not ready yet 2012-04-26 17:05:31 +02:00
Jesus Cea 2b47f0a23f Close #10142: Support for SEEK_HOLE/SEEK_DATA 2012-04-26 16:39:35 +02:00
Brett Cannon e0d88a173c Issue #14605: Make explicit the entries on sys.path_hooks that used to
be implicit.

Added a warning for when sys.path_hooks is found to be empty. Also
changed the meaning of None in sys.path_importer_cache to represent
trying sys.path_hooks again (an interpretation of previous semantics).
Also added a warning for when None was found.

The long-term goal is for None in sys.path_importer_cache to represent
the same as imp.NullImporter: no finder found for that sys.path entry.
2012-04-25 20:54:04 -04:00
Brett Cannon 8f79dd5d7c Silence DeprecationWarning for cgi.escape() usage in test_cgi. 2012-04-25 20:49:19 -04:00
Brett Cannon 5a5d6a1033 Merge 2012-04-25 20:18:24 -04:00
Antoine Pitrou f99983dacb Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test class that doesn't inherit from TestCase (i.e. a mixin). 2012-04-25 14:58:17 +02:00
Antoine Pitrou b05ac864f0 Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test class that doesn't inherit from TestCase (i.e. a mixin). 2012-04-25 14:56:46 +02:00
Vinay Sajip c94871a5c0 Merged fixed test from 3.2. 2012-04-25 10:51:35 +01:00
Vinay Sajip c2ad0aa9f1 Fixed test to work on Windows. 2012-04-25 10:47:00 +01:00
Marc-Andre Lemburg 7541c8ea37 Issue #14605 and #14642:
Issue a warning in case Python\importlib.h needs to be rebuilt,
but there's no Python interpreter around to freeze the bootstrap
script.
2012-04-25 10:54:48 +02:00
Brett Cannon 8923a4d4c5 Issue #14605: Insert to the front of sys.path_hooks instead of appending. 2012-04-24 22:03:46 -04:00
Marc-Andre Lemburg 4fe29c9657 Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader.
This time also recreating the Python/importlib.h file to make
make happy. See the ticket for details.
2012-04-25 02:31:37 +02:00
Marc-Andre Lemburg ac8805a01a Issue #14605: Revert renaming of _SourcelessFileLoader, since it caused
the buildbots to fail.
2012-04-25 02:11:07 +02:00
Marc-Andre Lemburg 2945e78b05 Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader 2012-04-25 01:36:48 +02:00
Vinay Sajip a5798ded26 Issue #14632: Updated WatchedFileHandler to deal with race condition. Thanks to John Mulligan for the problem report and patch. 2012-04-24 23:33:33 +01:00
Vinay Sajip 66b8b08752 Issue #14632: Updated WatchedFileHandler to deal with race condition. Thanks to John Mulligan for the problem report and patch. 2012-04-24 23:25:30 +01:00
Antoine Pitrou 5438ed1572 Issue #4892: multiprocessing Connections can now be transferred over multiprocessing Connections.
Patch by Richard Oudkerk (sbt).
2012-04-24 22:56:57 +02:00
Lars Gustäbel 9f478c021d Merge with 3.2: Issue #14160: TarFile.extractfile() failed to resolve symbolic
links when the links were not located in an archive subdirectory.
2012-04-24 21:09:17 +02:00
Lars Gustäbel 1ef9eda7bc Issue #14160: TarFile.extractfile() failed to resolve symbolic links
when the links were not located in an archive subdirectory.
2012-04-24 21:04:40 +02:00
Benjamin Peterson 15ee821eb5 distiguish between refusing to creating shared keys and error (#13903) 2012-04-24 14:44:18 -04:00
Martin v. Loewis 4f2f3b6217 Account for shared keys in type's __sizeof__ (#13903). 2012-04-24 19:13:57 +02:00
Benjamin Peterson 42f58818d6 merge 3.2 (#14658) 2012-04-24 11:09:20 -04:00
Benjamin Peterson 7b1668735a don't use a slot wrapper from a different special method (closes #14658)
This also alters the fix to #11603. Specifically, setting __repr__ to
object.__str__ now raises a recursion RuntimeError when str() or repr() is
called instead of silently bypassing the recursion. I believe this behavior is
more correct.
2012-04-24 11:06:25 -04:00
Antoine Pitrou 01296da8df Skip long repr tests when the cached pyc file's path length would exceed the maximum Win32 path length.
This should fix a failure on one of the XP buildbots.
2012-04-24 13:55:35 +02:00
Victor Stinner ece58deb9f Close #14648: Compute correctly maxchar in str.format() for substrin 2012-04-23 23:36:38 +02:00
Sandro Tosi f8ae4faf93 Issue #14650: fix typo in shutil.disk_usage() docstring; patch by Hobson Lane 2012-04-23 20:07:15 +02:00
Benjamin Peterson 9bc3653083 merge heads 2012-04-23 13:50:05 -04:00
Benjamin Peterson db780d0d13 fix instance dicts with str subclasses (#13903) 2012-04-23 13:44:32 -04:00
R David Murray a82c960c17 merge #14638: pydoc now treats non-str __name__ as None instead of raising
Original patch by Peter Otten.
2012-04-23 13:26:44 -04:00
R David Murray c43125a05c #14638: pydoc now treats non-str __name__ as None instead of raising
Original patch by Peter Otten.
2012-04-23 13:23:57 -04:00
Senthil Kumaran aa872d1690 3.2 - Fix for Issue13684 - httplib tunnel infinite loop 2012-04-23 23:53:51 +08:00
Senthil Kumaran b12771ab30 3.2 - Fix for Issue13684 - httplib tunnel infinite loop 2012-04-23 23:50:07 +08:00
Benjamin Peterson 7d95e40721 Implement PEP 412: Key-sharing dictionaries (closes #13903)
Patch from Mark Shannon.
2012-04-23 11:24:50 -04:00
Benjamin Peterson 80d07f8251 inherit maxchar of field value where needed (closes #14648) 2012-04-23 10:55:29 -04:00
Benjamin Peterson 1cf5aa9106 merge 3.2 2012-04-23 10:08:20 -04:00
Benjamin Peterson 7a436c5a53 sleep here 2012-04-23 10:08:14 -04:00
Brett Cannon 938d44d59c Issue #14605: Expose importlib.abc.FileLoader and
importlib.machinery.(FileFinder, SourceFileLoader,
_SourcelessFileLoader, ExtensionFileLoader).

This exposes all of importlib's mechanisms that will become public on
the sys module.
2012-04-22 19:58:33 -04:00
Brett Cannon 8c5e920ae3 merge 2012-04-22 13:30:07 -04:00
Brett Cannon 410e88d5fc Change tests for imp.cache_from_source() to follow os.path.join/split
semantics.
2012-04-22 13:29:47 -04:00
Vinay Sajip 4c3f47896e Issue #14644: Increased default timeout for SMTPHandler. Note: last commit message referred to the wrong issue number. 2012-04-22 18:19:50 +01:00
Vinay Sajip 26308da174 Issue #14622: Increased default timeout for SMTPHandler. 2012-04-22 18:16:14 +01:00
Brett Cannon 6240bd11ca merge 2012-04-22 13:02:31 -04:00
Brett Cannon 5c903e6ee1 Issue #13959: Continue to try to accomodate altsep in importlib by not
ignoring altsep if it already exists on a path when doing a join.
2012-04-22 11:45:07 -04:00
Charles-François Natali 84c0ca06d2 Use os.path.samestat() instead of reinventing the wheel. 2012-04-22 15:55:43 +02:00
Nick Coghlan 243994dc21 Resolve #14026 (Merge from 3.2) 2012-04-22 17:16:39 +10:00
Nick Coghlan 37fc401188 Close issue #14026 by better testing sys.argv handling in test_cmd_line_script (patch by Jason Yeo) 2012-04-22 17:11:33 +10:00
Brett Cannon cf649958f7 Revert to os.path.join() semantics for path manipulation in importlib
which is different than what imp.cache_from_source() operates on.
2012-04-22 02:06:23 -04:00
Brett Cannon a846236855 Continue the good fight to get Windows to like importlib by fixing a
variable name.
2012-04-21 21:46:32 -04:00
Brett Cannon 27f29d8483 merge 2012-04-21 21:21:54 -04:00
Brett Cannon 0d05a7698b Have importlib look for pre-existing path separators when joining
paths.
2012-04-21 21:21:27 -04:00
Senthil Kumaran f75822879b merge heads 2012-04-22 09:19:49 +08:00
Senthil Kumaran 3a441c1bed Fix Issue2193 - Allow ":" character in Cookie NAME values 2012-04-22 09:19:04 +08:00
Brett Cannon cb165db3a3 Fix whitespace. 2012-04-21 21:15:28 -04:00
Brett Cannon e69f0df45b Issue #13959: Re-implement imp.find_module() in Lib/imp.py.
Thanks to Eric Snow for taking an initial stab at the implementation.
2012-04-21 21:09:46 -04:00
Brett Cannon b8c0206bd4 Issue #14637: Fix the UNC import test under Windows to actually use
the UNC path. Also clean up sys.path and invalidate finder caches.

Thanks to Vinay Sajip for spotting the use of the wrong path.
2012-04-21 19:11:58 -04:00
Brett Cannon 2f92389d5c Don't worry about moving imp.get_tag() over to Lib/imp.py. 2012-04-21 18:55:51 -04:00
Brett Cannon b582c923ba merge 2012-04-21 18:53:14 -04:00
Brett Cannon a64faf0771 Issue #13959: Re-implement imp.source_from_cache() in Lib/imp.py. 2012-04-21 18:52:52 -04:00
Michael Foord 9cf5c9d85e Remove incorrect comment 2012-04-21 18:32:56 +01:00
Michael Foord 3af125a4aa Closes issue 14634. unittest.mock.create_autospec now supports keyword only arguments. 2012-04-21 18:22:28 +01:00
Michael Foord 2cd48738ba Closes issue 14636. mock objects raise exceptions from an iterable side_effect 2012-04-21 15:52:11 +01:00
Brett Cannon ea59dbff16 Issue #13959: Re-implement imp.cache_from_source() in Lib/imp.py. 2012-04-20 21:44:46 -04:00
Brett Cannon ed672d6872 Make path manipulation more robust for platforms with alternative path
separators.
2012-04-20 21:19:53 -04:00
Brett Cannon 24117a748b Issue #13959: Keep imp.get_magic() in C code, but cache in importlib
for performance. While get_magic() could move to Lib/imp.py, having to
support PyImport_GetMagicNumber() would lead to equal, if not more, C
code than sticking with the status quo.
2012-04-20 18:04:03 -04:00
Brett Cannon 9e924ed1ac Fix a cleanup. 2012-04-20 17:34:59 -04:00
Brett Cannon 5d5296d36e Merge 2012-04-20 17:19:14 -04:00
Mark Dickinson 9a359bd97f Issue #14630: Merge fix from 3.2. 2012-04-20 21:44:09 +01:00
Mark Dickinson bcc17eefd2 Issue #14630: Fix an incorrect access of ob_digit[0] for a zero instance of an int subclass. 2012-04-20 21:42:49 +01:00
Brett Cannon bbdc9cd3d2 Use a skipUnless decorator instead of conditional renaming. 2012-04-20 16:29:39 -04:00
Brett Cannon 1032af95ff Issue #14585: test_import now runs all tests under
importlib.test.import_ using builtins.__import__() instead of just the
relative import tests.
2012-04-20 15:52:17 -04:00
Brett Cannon f0434e647a Issue #14599: Generalize a test for ImportError.path and add support
in Python/dynload_shlibs.c.

This should fix the remaining importlib test failure on Windows.
Support in AIX and HP-UX will be in a separate checkin.
2012-04-20 15:22:50 -04:00
Brett Cannon a2898c1d79 Try to debug a Windows failure on the buildbots. 2012-04-20 13:34:35 -04:00
Brett Cannon c33f3f2339 Issue #14629: Mention the filename in SyntaxError exceptions from
tokenizer.detect_encoding() (when available).
2012-04-20 13:23:54 -04:00
Brett Cannon dd9a56953e Issue #14633: Simplify imp.find_modue() test after fixes from issue
#14629 changed the message.
2012-04-20 12:59:59 -04:00
Brett Cannon 8ff6baf25b Issue #14581: Windows users are allowed to import modules w/o taking
the file suffix's case into account, even when doing a case-sensitive
import.
2012-04-20 12:53:14 -04:00
Brett Cannon 91900eaf96 Have importlib.test.regrtest clear sys.path_importer_cache to make
sure finders from importlib are used instead of _frozen_importlib.
2012-04-20 12:51:44 -04:00
Martin v. Löwis 63c39fe38e merge 3.2: issue 14629 2012-04-20 14:37:17 +02:00
Martin v. Löwis 63674f4b52 Issue #14629: Raise SyntaxError in tokenizer.detect_encoding
if the first two lines have non-UTF-8 characters without an encoding declaration.
2012-04-20 14:36:47 +02:00
Victor Stinner 7b17a4e117 Close #14386: Register types.MappingProxyType as a Mapping 2012-04-20 01:41:36 +02:00
Larry Hastings 6fe20b3aee Issue #14127: Add st_{cma}time_ns fields to os.stat() result object. 2012-04-19 15:07:49 -07:00
Antoine Pitrou dd5aa36f17 Issue #14308: Fix an exception when a dummy thread is in the threading module's active list after a fork(). 2012-04-20 00:05:17 +02:00
Antoine Pitrou 8e6e0fdb7f Issue #14308: Fix an exception when a "dummy" thread is in the threading module's active list after a fork(). 2012-04-19 23:55:01 +02:00
Martin v. Löwis aa2efcb0bc Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.
Patch by Stefan Behnel.
2012-04-19 14:33:43 +02:00
Nick Coghlan e27b3608ef Merge from 3.2 2012-04-19 22:22:37 +10:00
Nick Coghlan 10ac77d2d8 Close #14032: fix incorrect variable reference in test_cmd_line_script 2012-04-19 22:19:36 +10:00
Ezio Melotti dea6c21a9c #14538: merge with 3.2. 2012-04-18 19:36:03 -06:00
Ezio Melotti 0780b6bc58 #14538: HTMLParser can now parse correctly start tags that contain a bare /. 2012-04-18 19:18:22 -06:00
Victor Stinner b0b224233e Issue #14385: Support other types than dict for __builtins__
It is now possible to use a custom type for the __builtins__ namespace, instead
of a dict. It can be used for sandboxing for example.  Raise also a NameError
instead of ImportError if __build_class__ name if not found in __builtins__.
2012-04-19 00:57:45 +02:00
Benjamin Peterson 2a481e58ff don't bother keeping a set we'll never use 2012-04-18 15:25:50 -04:00
Antoine Pitrou 23bba4ca39 Issue #11750: The Windows API functions scattered in the _subprocess and
_multiprocessing.win32 modules now live in a single module "_winapi".
Patch by sbt.
2012-04-18 20:51:15 +02:00
Benjamin Peterson 6e3358a1d5 merge 3.2 (#14612) 2012-04-18 11:19:00 -04:00
Benjamin Peterson e42fb307ed SETUP_WITH acts like SETUP_FINALLY for the purposes of setting f_lineno (closes #14612) 2012-04-18 11:14:31 -04:00
Benjamin Peterson d76bc7abac rollback 005fd1fe31ab (see #14609 and #14582)
Being able to overload a sys.module entry during import of a module was broken
by this changeset.
2012-04-18 10:55:43 -04:00
Brett Cannon 03c7ed1580 Merge 2012-04-17 21:42:07 -04:00
Brett Cannon 7bd329d800 Issue #12599: Be more strict in accepting None vs. a false-like object
in importlib.

Thanks to PJE for pointing out the issue and Nick Coghlan for filing
the bug.
2012-04-17 21:41:35 -04:00
Benjamin Peterson 2a1fdc4c76 merge 3.2 (#14607) 2012-04-17 19:54:35 -04:00
Benjamin Peterson 32c59b6fc1 mangle keyword-only argname when loading defaults (closes #14607) 2012-04-17 19:53:21 -04:00
Brett Cannon 64befe939c Issue #13959: Re-implement imp.load_compiled() in imp.py. 2012-04-17 19:14:26 -04:00
Brett Cannon 273323cf68 Issue #14592: A relative import will raise a KeyError if __package__
or __name__ are not set in globals.

Thanks to Stefan Behnel for the bug report.
2012-04-17 19:05:11 -04:00
Charles-François Natali fba807ac44 Issue #5113: Fix a test_posix failure on HP-UX, where non-root users can
chown() to root under certain circumstances.
2012-04-17 19:58:50 +02:00
Charles-François Natali ab2d58eefa Issue #5113: Fix a test_posix failure on HP-UX, where non-root users can
chown() to root under certain circumstances.
2012-04-17 19:48:35 +02:00
Charles-François Natali c8ce715a82 Issue #14087: multiprocessing: add Condition.wait_for(). Patch by sbt. 2012-04-17 18:45:57 +02:00
Ezio Melotti 006917ec7f #14603: use a listcomp in ZipFile.namelist. 2012-04-16 21:34:24 -06:00
Brett Cannon 578393b286 Properly guard against special-casing. 2012-04-16 23:11:28 -04:00
Brett Cannon 16475adcbb Issue #13959: Re-implement imp.load_source() in imp.py. 2012-04-16 22:11:25 -04:00
Brett Cannon 4132368d0a Issue #14599: Fix an import caching race condition. 2012-04-16 20:50:33 -04:00
Brett Cannon ceffda822f Issue #14599: Make test_reprlib robust against import cache race
conditions when regrtest is run with its -j option.
2012-04-16 20:48:50 -04:00
Brett Cannon de10bf4f4d Issue #13959: Fix a logic bug. 2012-04-16 20:44:21 -04:00
Antoine Pitrou de3c73b57c pep8-ize test names 2012-04-16 21:29:58 +02:00