Commit Graph

6720 Commits

Author SHA1 Message Date
Victor Stinner 1970b62aee Disable test_undecodable_code() of test_sys on Windows
This test is irrevelant on Windows
2010-08-25 00:20:27 +00:00
Victor Stinner ebe53a23c9 Fix test_sys for FreeBSD, Solaris and Mac OS X
_Py_char2wchar() (mbctowcs) decodes b'\xff' to '\xff' on FreeBSD, Solaris and
Mac OS X, even if the locale is C (and the locale encoding is ASCII). Patch
test_undecodable_code() to support this output and document the two different
kinds of outputs.
2010-08-24 23:05:51 +00:00
Daniel Stutzbach 31da5b2f69 Issue 8750: Fixed MutableSet's methods to correctly handle reflexive operations, namely x -= x and x ^= x 2010-08-24 20:49:57 +00:00
Benjamin Peterson 17689991e6 only catch AttributeError in hasattr() #9666 2010-08-24 03:26:23 +00:00
Giampaolo Rodolà bbc4782d77 fix issue 9601: ftplib now provides a workaround for invalid response code returned on MKD and PWD by non-compliant FTPserver implementations such as ISS shipped with Windows server 2003 2010-08-23 22:10:32 +00:00
Benjamin Peterson 076e031e54 cleanup imports 2010-08-23 21:58:59 +00:00
Benjamin Peterson 9c2930e4be run total_ordering() tests, and fix the function (default comparisons shouldn't be considered) 2010-08-23 17:40:33 +00:00
Martin v. Löwis 67e91ad9cf Explicitly pass socket type and family for getaddrinfo,
to make test work on Solaris.
Disable gethostbyaddr IDNA test for now as there is no
reverse DNS entry for the IPv6 address of the test name.
2010-08-23 15:27:26 +00:00
Antoine Pitrou 0723d2c78d Add an import lock test for multithreaded circular imports.
(part of #9657)
2010-08-22 20:43:26 +00:00
Martin v. Löwis 56773cf0d2 Mention that gethostbyaddr now also supports IDNA. 2010-08-22 19:38:04 +00:00
Martin v. Löwis fc0275a14a Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex and
getaddrinfo. Patch by David Watson.
2010-08-22 19:33:47 +00:00
Antoine Pitrou 7224d073d2 Test that calls to path hooks and meta_path entries are serialized by the import lock.
(part of issue #9251)
2010-08-22 10:18:36 +00:00
Raymond Hettinger 9117c75148 Issue #9214: Fix set operations on KeysView and ItemsView. 2010-08-22 07:44:24 +00:00
Antoine Pitrou b46b9d59ef Issue #9617: Signals received during a low-level write operation aren't
ignored by the buffered IO layer anymore.
2010-08-21 19:09:32 +00:00
Victor Stinner c44abb127b Workaround issue #8611 in test_undecodable_code() of test_sys
Write test.support.workaroundIssue8611() function so it will be easier to
remove this workaround from all tests.
2010-08-20 16:52:14 +00:00
Victor Stinner 1b6372a1d1 test_undecodable_code(): set locale to C
The test is still failing on "x86 FreeBSD 7.2 3.x" and "sparc solaris10 gcc
3.x" buildbots. It looks like the locale encoding is able to decode b'\xff'. I
suppose that it is an encoding like 'iso-8859-1'.

Use C locale to set, I hope, the locale encoding to 'ascii'. Display also the
encoding so if the test fails, at least I will learn the locale encoding
choosen for the C locale.
2010-08-20 16:38:14 +00:00
Victor Stinner e6376f8849 test_main_invalid_unicode() of test_sys: print string as ascii
There are buildbot failures on "x86 FreeBSD 3.x" and "sparc solaris10 gcc 3.x".
I suppose that _Py_char2wchar() doesn't fail even if the locale encoding is
unable to decode the byte string, because _Py_char2wchar() has a special mode
for platform without mbrtowc() (ISO C99) function.

Let's check my theory by avoid error on the Python print() instruction.
2010-08-20 11:08:18 +00:00
Amaury Forgeot d'Arc 12844e6df6 Add tests for r84209 (crashes in the Ast builder)
Also remove one tab, and move a check closer to the possible failure.
2010-08-19 21:32:38 +00:00
Victor Stinner 5c1808a1a8 test_pep277: display the filename as ascii on failure 2010-08-19 17:35:00 +00:00
Victor Stinner 114b724a4b Skip test_encodings() of test_os on Windows and Mac OS X 2010-08-19 17:22:57 +00:00
Victor Stinner 515ca2047d test_main_invalid_unicode() of test_sys displays stderr on failure 2010-08-19 17:18:12 +00:00
Victor Stinner 38430e2dff Fix os.get_exec_path() (code and tests) for python -bb
Catch BytesWarning exceptions.
2010-08-19 17:10:18 +00:00
Victor Stinner 99435247e3 Ooops, finish test_sys fix: use expected variable 2010-08-19 11:30:09 +00:00
Victor Stinner 85ca2afe3b Fix test_sys about fs encoding for Windows and Mac OS X
* Check fs encoding value on Windows
 * Ignore LANG= test on Windows and Mac OS X (fs encoding is hardcoded on these
   platforms)
2010-08-19 11:23:47 +00:00
Victor Stinner 70f88c59eb Fix test_os: workaround #8611 bug 2010-08-19 11:17:12 +00:00
Victor Stinner e8d5145e18 Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
error handler, or strict error handler on Windows.

 * Rewrite os.fsencode() documentation
 * Improve os.fsencode and os.fsdecode() tests using the new PYTHONFSENCODING
   environment variable
2010-08-19 01:05:19 +00:00
Victor Stinner c732e3ba08 test_sys: move tests at the right place
filesystem encoding is not related to sys.sizeof()
2010-08-18 22:44:15 +00:00
Victor Stinner 398356baaa Improve error message if the command is not decodable 2010-08-18 22:23:22 +00:00
Amaury Forgeot d'Arc 7e44b6b0c5 Add more tests to unicodedata with large code points
(the other functions where not affected by the recent change)
2010-08-18 22:07:15 +00:00
Victor Stinner 94908bbc15 Issue #8622: Add PYTHONFSENCODING environment variable to override the
filesystem encoding.

initfsencoding() displays also a better error message if get_codeset() failed.
2010-08-18 21:23:25 +00:00
Amaury Forgeot d'Arc 56ab01b66a Fix stupid typo in test. 2010-08-18 21:12:52 +00:00
Victor Stinner 74a833fa96 Decompose TESTFN_UNICODE on Mac OS X 2010-08-18 21:06:23 +00:00
Amaury Forgeot d'Arc 324ac65ceb #5127: Even on narrow unicode builds, the C functions that access the Unicode
Database (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others) now accept
and return characters from the full Unicode range (Py_UCS4).

The differences from Python code are few:
- unicodedata.numeric(), unicodedata.decimal() and unicodedata.digit()
  now return the correct value for large code points
- repr() may consider more characters as printable.
2010-08-18 20:44:58 +00:00
Antoine Pitrou 36e778ef02 Issue #9433: The "-j" option to regrtest now works under Windows too.
It is not sure it will be beneficial, though, since process launching is
more expensive under Windows than it is under Linux.
2010-08-18 20:44:14 +00:00
Victor Stinner d91df1a7a9 Improve PEP 383 tests (in test_os)
* Use the current filesystem encoding instead of always using utf-8
 * Enable the test on Mac OS X
 * Use TESTFN_UNENCODABLE and TESTFN_UNICODE instead of arbitrary filenames
 * To decode a filename, use strict error handler instead surrogateescape for
   mbcs encoding (on Windows)
 * Use TESTFN_UNENCODABLE (if available) for the directory name

Skip the test if no non-ascii filename can be created.
2010-08-18 10:56:19 +00:00
Antoine Pitrou 79c5ef11d5 Issue #3488: Provide convenient shorthand functions `gzip.compress`
and `gzip.decompress`.  Original patch by Anand B. Pillai.
2010-08-17 21:10:05 +00:00
Giampaolo Rodolà 42382fedcc fix issue #8807: adds a context parameter to POP3_SSL class. 2010-08-17 16:09:53 +00:00
Giampaolo Rodolà ccfb91c89f fix issue #8866: parameters passed to socket.getaddrinfo can now be specified as single keyword arguments. 2010-08-17 15:30:23 +00:00
Nick Coghlan d26c18adcc Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory 2010-08-17 13:06:11 +00:00
Nick Coghlan 46e6380563 Another attempt at pacifying the windows buildbots by ignoring all the variable information in the dis.code_info tests 2010-08-17 11:28:07 +00:00
Nick Coghlan 77203adb7e Ignore the exact ID value for the nested function in the dis.code_info tests 2010-08-17 09:25:57 +00:00
Ezio Melotti fc8b205da2 Correct a couple of assert* methods. Patch by Dave Malcolm. 2010-08-17 08:35:41 +00:00
Nick Coghlan eae2da1da7 Issue 9147: Add dis.code_info() 2010-08-17 08:03:36 +00:00
Nick Coghlan 9887683f74 Document and test the resolution of issue 3445 (tolerate missing attributes in functools.update_wrapper, previously implemented as a side effect of the __annotations__ copying patch) and implement issue 9567 (add a __wrapped__ attribute when using update_wrapper) 2010-08-17 06:17:18 +00:00
Benjamin Peterson 052a02be4a add tests for mknod() and mkfifo() #9569 2010-08-17 01:27:09 +00:00
Benjamin Peterson 82c4885210 remove test for oldstyle classes 2010-08-17 01:08:46 +00:00
Benjamin Peterson 83cd3b91e2 use assertTrue/assertFalse 2010-08-17 01:07:53 +00:00
Benjamin Peterson 45c257f193 add support for abstract class and static methods #5867 2010-08-17 00:52:52 +00:00
Victor Stinner 36e791179c test_zipimport: fix test name 2010-08-17 00:44:11 +00:00
Florent Xicluna c9c29e2ab2 I get it wrong in r84097: s/relative/absolute/ 2010-08-16 19:03:05 +00:00
Alexander Belopolsky e29e6bffb5 Issue #665761: functools.reduce() will no longer mask exceptions other
than TypeError raised by the iterator argument.  Also added a test to
check that zip() already behaves similarly.
2010-08-16 18:55:46 +00:00
Florent Xicluna 27354ccec9 Use test.support and unittest features. Fix duplicated test (bad merge in r79033). Fix comment for issue #7902. 2010-08-16 18:41:19 +00:00
Victor Stinner 2460a43a65 Issue #9425: read_directory() is fully unicode compliant
zipimport is now able to load a module with an unencodable filename.
2010-08-16 17:54:28 +00:00
Antoine Pitrou 982c018b32 Remove debug hack 2010-08-16 14:33:42 +00:00
Giampaolo Rodolà 677d95c258 fix getaddrinfo test failure on OSX caused by AI_CANNAME erroneously used as the value for 'proto' 2010-08-16 05:08:11 +00:00
Richard Jones daf235032f close down sockets held by asyncore at end of test; closes issue9619 2010-08-16 01:48:14 +00:00
Antoine Pitrou b14ac8c2b0 Save and restore the global asyncore.socket_map, and warn if a test modified it 2010-08-16 00:28:05 +00:00
Antoine Pitrou ed9863685f Add debug output to the asyncore test 2010-08-15 23:28:10 +00:00
Antoine Pitrou f4c7badc02 Put test_ciphers in NetworkedTests 2010-08-15 23:02:22 +00:00
Antoine Pitrou 968dc03f24 Following Ezio's suggestion, force verbose mode on test_ssl to diagnose freezes on 3.x 2010-08-15 22:16:23 +00:00
Florent Xicluna dc692740a8 Replace the deprecated ConfigParser.readfp() method, and fix the incomplete merge in r82293. 2010-08-15 20:16:27 +00:00
Victor Stinner a0241c8587 Fix TESTFN_UNENCODABLE of test.support on Mac OS X 2010-08-15 19:28:21 +00:00
Raymond Hettinger f309828175 Remove the lfu_cache. Add more tests. 2010-08-15 03:30:45 +00:00
Raymond Hettinger 0f56e90f05 Support cache sizes. 2010-08-14 23:52:08 +00:00
Florent Xicluna 62829dc727 Silence BytesWarning while testing exception 2010-08-14 20:51:58 +00:00
Victor Stinner 03c9e1dbc2 Mac OS X denies unencodable filenames (invalid utf-8) 2010-08-14 17:35:20 +00:00
Giampaolo Rodolà 419f704d76 fix issue #8857: provide a test case for socket.getaddrinfo 2010-08-14 16:45:41 +00:00
Antoine Pitrou ab6190f9aa There doesn't seem to be a reason for this test to be disabled. 2010-08-14 16:33:38 +00:00
Antoine Pitrou d151e27446 This is a better resolution than r84021 (because it will also affect
ssl.get_server_certificate()).
2010-08-14 16:32:10 +00:00
Antoine Pitrou 35bebe12e0 Add a reasonable timeout to network SSL tests, so as to avoid buildbot timeouts
when the remote server doesn't answer.
2010-08-14 16:24:38 +00:00
Florent Xicluna aa17106e41 Merged manually from 2.7 branch to 3.x trunk.
------------------------------------------------------------------------
  r79925 | nick.coghlan | 2010-04-10 16:24:36 +0200 (sam. 10 avril 2010)

  Try to turn some buildbots green by allowing test_multiprocessing to
  pass even if it hits the sys.exc_clear code in the threading module, and
  improve the test coverage by making the ctypes dependencies a bit more
  granular (two of the cited ctypes objects don't exist on my system)
  ------------------------------------------------------------------------
2010-08-14 15:56:42 +00:00
Victor Stinner 09c449c7de Fix a typo: TESTFN_UNENCODEABLE => TESTFN_UNENCODABLE 2010-08-13 22:23:24 +00:00
Brian Curtin d835cf1c84 Fix #9588. Add sys.executable to two shell=True tests. 2010-08-13 20:42:57 +00:00
Antoine Pitrou 3060c4573f Reapply r83877. 2010-08-13 16:27:38 +00:00
Antoine Pitrou 6fdb74f0ae Re-apply r83871. 2010-08-13 16:26:40 +00:00
Victor Stinner b4b8eb9163 Oops, I did it again: add missing \ removed in previous commit 2010-08-13 13:47:18 +00:00
Victor Stinner 11fd4e962d Oops, create TESTFN_UNENCODEABLE from TEST_FN, not TESTFN_UNICODE
test_imp fails on Linux with C locale because TESTFN_UNICODE is not encodable
to ascii.
2010-08-13 13:45:00 +00:00
Victor Stinner 1a4d12d746 Issue #9425: NullImporter constructor is fully unicode compliant
* On non-Windows OSes: the constructor accepts bytes filenames
   and use surrogateescape for unicode filenames
 * On Windows: use GetFileAttributesW() instead of GetFileAttributesA()
2010-08-13 13:07:29 +00:00
Victor Stinner 3d85a6fa04 Set TESTFN_UNENCODEABLE on non-Windows OSes
* Use 0xff byte on non-Windows OSes
 * mbcs is now really strict by default: i closed the issue #850997, so use the
   filesystem encoding and not Latin-1
 * Rename TESTFN_UNICODE_UNENCODEABLE to TESTFN_UNENCODEABLE
2010-08-13 13:02:04 +00:00
Eric Smith 994addc414 Remove unused test class. 2010-08-12 21:55:30 +00:00
Antoine Pitrou 7c8bcb6f92 Issue #7467: when a file from a ZIP archive, its CRC is checked and a
BadZipfile error is raised if it doesn't match (as used to be the
case in Python 2.5 and earlier).
2010-08-12 15:11:50 +00:00
Tim Golden 126c2960ca #2304: fix incorporating Eric Smith's .format suggestion and tested on Ubuntu as well as Windows 2010-08-11 14:20:40 +00:00
Antoine Pitrou 32cfedeb1c Issue #9550: a BufferedReader could issue an additional read when the
original read request had been satisfied, which can block indefinitely
when the underlying raw IO channel is e.g. a socket.  Report and original
patch by Jason V. Miller.
2010-08-11 13:31:33 +00:00
Mark Dickinson cf940c701f Issue #9530: Fix undefined-behaviour-inducing overflow checks in bytes and bytearray implementations. 2010-08-10 18:35:01 +00:00
Antoine Pitrou 817c9df7e5 test_winsound shouldn't crash when ctypes isn't available 2010-08-10 00:45:32 +00:00
Antoine Pitrou 5af4f4b983 Issue #3757: thread-local objects now support cyclic garbage collection.
Thread-local objects involved in reference cycles will be deallocated
timely by the cyclic GC, even if the underlying thread is still running.
2010-08-09 22:38:19 +00:00
Antoine Pitrou 6e451df800 Followup to r83869 and issue #8524: rename socket.forget() to socket.detach()
and make it return the file descriptor.
2010-08-09 20:39:54 +00:00
Florent Xicluna 87082ee14d Merged manually from 2.7 branch to 3.x trunk.
------------------------------------------------------------------------
  r81149 | florent.xicluna | 2010-05-13 23:40:01 +0200 (jeu. 13 mai 2010) | 2 lignes

  Better test skipping, with message in the log.
  ------------------------------------------------------------------------
  r81150 | florent.xicluna | 2010-05-13 23:41:05 +0200 (jeu. 13 mai 2010) | 2 lignes

  Improve test feedback to troubleshoot issue #8423 on OS X.
  ------------------------------------------------------------------------
  r81151 | florent.xicluna | 2010-05-14 01:46:48 +0200 (ven. 14 mai 2010) | 2 lignes

  Revert changeset r81150 which helped diagnose issue #8423 on some OS X buildbot.
  ------------------------------------------------------------------------
  r82056 | florent.xicluna | 2010-06-17 22:30:56 +0200 (jeu. 17 juin 2010) | 2 lignes

  Add few words about test.test_genericpath.CommonTest
  ------------------------------------------------------------------------
2010-08-09 17:18:05 +00:00
Florent Xicluna ec882214fe Merged manually from 2.7 branch to 3.x trunk.
------------------------------------------------------------------------
  r80411 | florent.xicluna | 2010-04-23 19:59:10 +0200 (ven. 23 avril 2010) | 2 lignes

  Remove ImportWarnings filters.  They become obsolete after r79310, issue #8205.
  ------------------------------------------------------------------------
  r80412 | florent.xicluna | 2010-04-23 20:10:12 +0200 (ven. 23 avril 2010) | 2 lignes

  Fix the "regrtest -s" switch.
  ------------------------------------------------------------------------
  r81140 | florent.xicluna | 2010-05-13 19:05:29 +0200 (jeu. 13 mai 2010) | 3 lignes

  Add sensible information about the OS X platform to diagnose issue #8423:
  test_pep277 fails on "x86 Tiger" buildbot but not on "PPC Tiger".
  ------------------------------------------------------------------------
  r81141 | florent.xicluna | 2010-05-13 20:16:06 +0200 (jeu. 13 mai 2010) | 2 lignes

  Revert the additional OS X information (r81140).  Keep the endianness information.
  ------------------------------------------------------------------------
2010-08-09 16:56:43 +00:00
Fred Drake a492362f9a issue #9452:
Add read_file, read_string, and read_dict to the configparser API;
new source attribute to exceptions.
2010-08-09 12:52:45 +00:00
Antoine Pitrou f14c263280 Also temporarily revert r83871, to fix compilation on buildbots 2010-08-09 12:47:33 +00:00
Antoine Pitrou aba74bddd6 Revert r83877 in order to fix compilation 2010-08-09 10:47:46 +00:00
Senthil Kumaran 9f347ea545 reapply the revert made in r83875
Now the _collections is statically built, the build dependencies are in proper
order and build works fine.

Commit Log from r83874:
Issue 9396.   Apply functools.lru_cache in the place of the
random flushing cache in the re module.
2010-08-09 07:30:53 +00:00
Raymond Hettinger 31022301b5 Revert 83784 adding functools.lru_cache() to the re module.
The problem is that the re module is imported by sysconfig
and re needs functools which uses collections.OrderedDict()
but the _collectionsmodule.c code is not yet constructed
at this point in the build.

The likely best solution will be to include _collections
as part of the static build before the rest of the
boot-strapping.
2010-08-09 05:56:50 +00:00
Raymond Hettinger 4f859ed9c7 Issue 9396. Apply functools.lru_cache in the place of the
random flushing cache in the re module.
2010-08-09 04:24:42 +00:00
Raymond Hettinger 5b0c1e07ca Issue 7846: fnmatch cache can grow without bound
Updated to solution to use the functools.lru_cache().
Restores the API so that purge() is not needed
(because the cache never gets big).
2010-08-09 02:07:15 +00:00
Antoine Pitrou e43f9d0ed6 Issue #8524: Add a forget() method to socket objects, so as to put the
socket into the closed state without closing the underlying file
descriptor.
2010-08-08 23:24:50 +00:00
Florent Xicluna ba8a98600e Fix xml.etree.ElementInclude to include the tail of the current node. Issue #6231 2010-08-08 23:08:41 +00:00
Florent Xicluna 14bd1c3b2e Fix BytesWarning in test_xml_etree, introduced with r83851. 2010-08-08 22:58:56 +00:00
Victor Stinner d62e6cabca Issue #9425: file system encoding is not always utf-8
Fix a regression introduced in test_sys by r83778.
2010-08-08 22:31:44 +00:00
Antoine Pitrou 696e03553b Issue #477863: Print a warning at shutdown if gc.garbage is not empty. 2010-08-08 22:18:46 +00:00
Florent Xicluna c17f17294f Issue #8047: Fix the xml.etree serializer to return bytes by default.
Use ``encoding="unicode"`` to generate a Unicode string.
2010-08-08 19:48:29 +00:00
Benjamin Peterson 1a0a737b13 revert r83830, breaks tests on unixes 2010-08-08 19:08:44 +00:00
Florent Xicluna 39d795d8c1 Issue #7564: Skip test_ioctl if another process is attached to /dev/tty. 2010-08-08 18:06:13 +00:00
Mark Dickinson 93d768d632 Remove unused import. 2010-08-08 17:12:46 +00:00
Florent Xicluna 37d3d9aa96 Add test case for the HTTPResponse being an iterable. Follow-up of issue #4608. 2010-08-08 16:25:27 +00:00
Tim Golden e3f76168a9 Issue #2304: Add additional quotes when using cmd shell on Windows. Original patch from Gabriel Genellina 2010-08-08 16:17:48 +00:00
Florent Xicluna 419e384601 Use unittest specific methods for some urllib test cases. And replace urllib2 with urllib.request in comments. 2010-08-08 16:16:07 +00:00
Senthil Kumaran d95cc75483 Fix Issue8280 - urllib2's Request method will remove fragements in the url.
This is how it should work,wget and curl work like this way too. Old behavior was wrong.
2010-08-08 11:27:53 +00:00
Raymond Hettinger d331ce9e66 Issue #9507: Named tuple repr will now automatically display the right
name in a tuple subclass.
2010-08-08 01:13:42 +00:00
Mark Dickinson af43e9a288 Issue #8433: Fix test_curses failure for platforms with recent versions of ncurses. 2010-08-07 12:33:36 +00:00
Victor Stinner 6c6f851eae Issue #9425: skip tests if a filename is not encodable 2010-08-07 10:09:35 +00:00
Brian Curtin 42143562c2 Fix an assertRaises situation and typo. Also pass all tests to run_unittest
rather than do it by platform -- the proper skips are in place already.
2010-08-07 03:47:21 +00:00
Brian Curtin ef9efbd69c Fix #9324: Add parameter validation to signal.signal on Windows in order
to prevent crashes.
2010-08-06 19:27:32 +00:00
Tim Golden af5ac3974b Issue #3210: Ensure stdio handles are closed if CreateProcess fails 2010-08-06 13:03:56 +00:00
Mark Dickinson 388122d43b Issue #9337: Make float.__str__ identical to float.__repr__.
(And similarly for complex numbers.)
2010-08-04 20:56:28 +00:00
Antoine Pitrou 560f7647ce Issue #8814: function annotations (the `__annotations__` attribute)
are now included in the set of attributes copied by default by
functools.wraps and functools.update_wrapper.  Patch by Terrence Cole.
2010-08-04 18:28:02 +00:00
Antoine Pitrou 23df483cb6 Try to fix issue #9415: skip some tests on broken Ubuntu OpenSSL 2010-08-04 17:14:06 +00:00
Antoine Pitrou 15cee6209f In verbose mode, identify OpenSSL build and platform more precisely 2010-08-04 16:45:21 +00:00
Antoine Pitrou 482e66a58a Issue #9496: Provide a test suite for the rlcompleter module. Patch by
Michele Orrù.
2010-08-04 15:43:16 +00:00
Richard Jones 6a9e6bbf1a fix test_smtplib/test_smtpd collision through pre-loaded reply data in mock_socket 2010-08-04 12:27:36 +00:00
Antoine Pitrou 62f68ed31f Factor out stripping of interpreter debug output in test.support.strip_python_stderr() 2010-08-04 11:48:56 +00:00
Giampaolo Rodolà f96482e91a as per discussion with antoine revert changes made in 83708 as the user useing ftplib's readline methods is supposed to always use a binary file 2010-08-04 10:36:18 +00:00
Giampaolo Rodolà b939235c6a fix issue #6822: ftplib's storline method doesn't work with text files 2010-08-04 10:12:00 +00:00
Giampaolo Rodolà b5c23761d3 issue #8687: provides a test suite for sched.py module 2010-08-04 09:28:05 +00:00
Senthil Kumaran 84c7d9f87b Fix Issue754016 - urlparse goes wrong with IP:port without scheme 2010-08-04 04:50:44 +00:00
Richard Jones 4aa0d4d2d0 improve smtpd module test coverage 2010-08-04 01:20:14 +00:00
Antoine Pitrou 577ba7d43a That test was never run (since thread has been renamed to _thread in 3.x) 2010-08-04 00:18:49 +00:00
Antoine Pitrou da991da30b In test_threading_local, test both the default _thread._local implementation
and the pure Python implementation in Lib/_threading_local.py
2010-08-03 18:32:26 +00:00
R. David Murray 88c49fe320 #9444: use first of prefix_chars for help opt instead of raising error
An argparse option parser created with a prefix_chars that did not
include a '-' would happily add -h and --help options, and then throw
an error when it tried to format the help because the - was an invalid
prefix character.  This patch makes it use the first character of
prefix_chars as the character for the help options if and only if '-'
is not one of the valid prefix_chars.

Fix by Theodore Turocy, unit tests by Catherine Devlin.
2010-08-03 17:56:09 +00:00
Georg Brandl e8e02e3b5b Fix regrtest -F. 2010-08-03 07:56:50 +00:00
Richard Jones 64b02de010 improvements to test_smtplib per issue2423
merged the socket mock introduced in test_smtpd
2010-08-03 06:39:33 +00:00
Georg Brandl dee7b8503d #8560: add progress indicator to regrtest. 2010-08-02 18:59:52 +00:00
Georg Brandl 6fcac0d6f6 Move test_SimpleHTTPServer into test_httpservers. 2010-08-02 18:56:54 +00:00
Georg Brandl 2d3c4e79a1 #7372: fix regression in pstats: a previous fix to handle cProfile data in add_callers broke handling of profile data. 2010-08-02 17:24:49 +00:00
Georg Brandl 283b125551 #3821: beginnings of a trace.py unittest. 2010-08-02 12:48:46 +00:00
Senthil Kumaran 9f8dc4441f Fix Issue8572 - httplib getheader() throws error instead of default 2010-08-02 11:04:58 +00:00
Antoine Pitrou 7ffa196dce Issue #8397: Raise an error when attempting to mix iteration and regular
reads on a BZ2File object, rather than returning incorrect results.
2010-08-01 20:08:46 +00:00
Ronald Oussoren 7fb6f5121a test_getgroups as introduced with issue7900 failed on systems
where 'id -G' and posix.getgroups() returned the same information,
but one of the sources contains duplicate information. Rewrite the
check using sets instead of lists.
2010-08-01 19:18:13 +00:00
Senthil Kumaran de0eb249c6 Fix Issue8123 - TypeError in urllib when trying to use HTTP authentication 2010-08-01 17:53:37 +00:00
Brian Curtin ea47eaa395 Fix #8105. Add validation to mmap.mmap so invalid file descriptors
don't cause a crash on Windows.
2010-08-01 15:26:26 +00:00
Georg Brandl 0bccc185b4 #8046: add context manager protocol support to mmap objects. Also add closed property. 2010-08-01 14:50:00 +00:00
Mark Dickinson 5b1d35b9c7 Add test for memory leak reported in issue 9422. 2010-08-01 11:10:28 +00:00
Mark Dickinson 5b65df7ce2 Issue #9416: Fix some issues with complex formatting where the
output with no type specifier failed to match the str output:

  - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
  - format(complex(0.0, 2.0), '-') included a sign and parentheses.
2010-08-01 10:41:49 +00:00
Georg Brandl b16e38b825 #8826: the "expires" attribute value is a date string with spaces, but apparently not all user-agents put it in quotes. Handle that as a special case. 2010-08-01 09:06:34 +00:00
Ronald Oussoren bda4672b01 Ensure that test_site actually passes with a framework build 2010-08-01 09:02:50 +00:00
Georg Brandl f325e03f48 #8230: make Lib/test/sortperf.py run on Python 3. 2010-08-01 08:07:49 +00:00
Georg Brandl 33b6a31c18 #8768: name test method properly so that it gets executed. 2010-08-01 06:44:46 +00:00
R. David Murray 7905d61b2c #8620: Cmd no longer truncates last character if stdin ends without newline
Cmd used to blindly chop off the last character of every input line.  If
the input reached EOF and there was no final new line, it would truncate
the last character of the last command.  This fix instead strips trailing
\r\n from the input lines.  While this is a small behavior change, it
should not break any working code, since feeding a '\r\n' terminated
file to Cmd would previously leave the \r's on the lines, resulting
in failed command execution.

I wrote the unit test in preparation for a PyOhio TeachMe session
run by Catherine Devlin, and we can thank Catherine and the PyOhio
session attendees for the fix.  I've added Catherine to the Acks file
for organizing and leading the TeachMe session, out of which we will
hopefully get some new contributors.
2010-08-01 03:31:09 +00:00
Georg Brandl cfb68218b7 #7909: the prefixes \\.\ and \\?\ indicate special Windows paths, do not try to manipulate them. See http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx for details. 2010-07-31 21:40:15 +00:00
Georg Brandl a8867b4173 There always is a False and True now. 2010-07-31 21:26:40 +00:00
Georg Brandl 4f85ae10f5 #8910: add a file explaining why Lib/test/data is there. 2010-07-31 21:12:15 +00:00
Georg Brandl 76e155a157 #3788: more tests for http.cookies, now at 95% coverage. Also bring coding style in the module up to PEP 8, where it does not break backwards compatibility. 2010-07-31 21:04:00 +00:00
Georg Brandl 7b280e9197 Clarify comment in comments test case explaining comment semantics. 2010-07-31 20:13:44 +00:00
Georg Brandl 6cb7b6593e #1286: allow using fileinput.FileInput as context manager. 2010-07-31 20:08:15 +00:00
Georg Brandl ec5ae3b9f5 Fix bad merge: test_support -> support. 2010-07-31 19:17:11 +00:00
Georg Brandl 38005e8156 #9440: Remove borderline test case that fails based on unpredictable conditions such as compiler flags. 2010-07-31 18:11:07 +00:00
Georg Brandl 2e7346acc9 Re-commit r83327 now that the release is done. 2010-07-31 18:09:23 +00:00
Georg Brandl a8fbc6a521 Import test_pdb with its full name, so that running python -m test.test_pdb succeeds. 2010-07-31 11:52:46 +00:00
Georg Brandl 014e0ca58e Revert r83327. This will have to wait until after the alpha1 release. 2010-07-31 10:16:21 +00:00
Raymond Hettinger 9e46ef819c Add functools.lfu_cache() and functools.lru_cache(). 2010-07-31 10:11:39 +00:00
Georg Brandl 17e3d698b5 Avoid triggering DeprecationWarnings in test_smtpd and smtpd. 2010-07-31 10:08:09 +00:00
Florent Xicluna c049fca0da Fix an oversight in r83294. unquote() should reject bytes. Issue #9301. 2010-07-31 08:56:55 +00:00
Georg Brandl 604ef370b3 Make urllib tests pass for now. Will figure out what the correct semantics should be after release. 2010-07-31 08:20:02 +00:00
Georg Brandl e1e8df1082 Fix pdb test failures on the buildbots. 2010-07-31 08:14:16 +00:00
Senthil Kumaran d496c4c936 Fix issue9301 - handle unquote({}) kind of case. 2010-07-30 19:34:36 +00:00
Georg Brandl 0a9c3e91dc Show the traceback line numbers as well as the current line numbers if an exception is being debugged. Courtesy of pdb++ by Antonio Cuni. Also document -> and >> markers for "list". 2010-07-30 18:46:38 +00:00
Georg Brandl cdf66a9a7c Test that "source" with nonexisting things works as expected. 2010-07-30 18:15:16 +00:00
Georg Brandl e59ca2afe3 Add "longlist" and "source" commands, ideas borrowed from pdb++ by Antonio Cuni. 2010-07-30 17:04:28 +00:00
Georg Brandl 0d08962659 Several enhancements to pdb and its test suite.
* added basic test for basic commands
* removed duplication of command docs, and moved them to their implementation
* unified and useful display of exceptions
* output messages and errors using overridable methods (also fixes #1503502)
2010-07-30 16:00:46 +00:00
Georg Brandl 9d624d26d1 pdb now has its own tests. 2010-07-30 15:33:52 +00:00
Georg Brandl 6cccb865d1 #7964 followup: add test case to ensure issue remains fixed. 2010-07-30 14:16:43 +00:00
Georg Brandl 7410dd11ef #809887: improve pdb feedback for breakpoint-related actions. Also add a functional test for these commands. 2010-07-30 12:01:20 +00:00
Georg Brandl 3f94089a77 #5294: Fix the behavior of pdb "continue" command when called in the top-level debugged frame. 2010-07-30 10:29:19 +00:00
Georg Brandl 25fbb891d8 Issue #8048: Prevent doctests from failing when sys.displayhook has
been reassigned.
2010-07-30 09:23:23 +00:00
Georg Brandl 46b9afc862 #1472251: remove addition of "\n" to code given to pdb.run[eval](), the bug in exec() that made this necessary has been fixed. Also document that you can give code objects to run() and runeval(), and add some tests to test_pdb. 2010-07-30 09:14:20 +00:00
Georg Brandl 0a0fc07d37 #4108: the first default entry (User-agent: *) wins. 2010-07-29 17:55:01 +00:00
Georg Brandl 6d23c44ee5 Fix #9412: make list of messages an instance attribute instead of class attribute. 2010-07-29 13:19:42 +00:00
Georg Brandl 8dcaa7396f #9411: allow selecting an encoding for configparser files. Also adds a new test config file to test special cases. 2010-07-29 12:17:40 +00:00
Victor Stinner 96f0de9004 Update test_os.py according to my last changes on _Environ.__repr__() 2010-07-29 00:29:00 +00:00
Georg Brandl aa5b33311a Add missing file. 2010-07-28 17:37:27 +00:00
Florent Xicluna 02ea12b291 Syntax cleanup. 2010-07-28 16:39:41 +00:00
Senthil Kumaran 3f8ab965f7 Fix Issue6325 - robotparse to honor urls with query strings. 2010-07-28 16:27:56 +00:00
Georg Brandl 96a60ae90c #1682942: add some ConfigParser features: alternate delimiters, alternate comments, empty lines in values. Also enhance the docs with more examples and mention SafeConfigParser before ConfigParser. Patch by Lukas Langa, review by myself, Eric and Ezio. 2010-07-28 13:13:46 +00:00
Georg Brandl cbb0ae4a42 #9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa. 2010-07-28 08:19:35 +00:00
Ezio Melotti 9a381c7a02 With skipUnless there is no need to add test classes conditionally. 2010-07-27 22:24:13 +00:00
Ezio Melotti 63c4640327 Use proper skips and assert* methods in test_asyncore. 2010-07-27 22:03:33 +00:00
Florent Xicluna f1046ca817 Issue #4770: Restrict binascii module to accept only bytes (as specified).
And fix the email package to encode to ASCII instead of ``raw-unicode-escape`` before ASCII-to-binary decoding.
2010-07-27 21:20:15 +00:00
Gregory P. Smith 5a63183a8b The default size of the re module's compiled regular expression cache has
been increased from 100 to 500 and the cache replacement policy has changed
from simply clearing the entire cache on overflow to randomly forgetting 20%
of the existing cached compiled regular expressions.  This is a performance
win for applications that use a lot of regular expressions and limits the
impact of the performance hit anytime the cache is exceeded.
2010-07-27 05:31:29 +00:00
Alexander Belopolsky aeb039863d Make python version of fromtimestamp behave more like C. 2010-07-26 02:36:41 +00:00
Brian Curtin 9a27b0cd19 Fix #7113. Patch by Łukasz Langa.
Changes include using a list of lines instead of patching together using
string interpolation, and a multi-line value test cases.
2010-07-26 00:27:10 +00:00
Andrew M. Kuchling 688b9e384e #777884: make .normalize() do nothing for childless nodes, instead of raising an exception 2010-07-25 23:38:47 +00:00
Michael Foord bd6c079552 Issue #4686 - add .args to exceptions in the configparsermodule 2010-07-25 23:09:25 +00:00
Alexander Belopolsky 07de165d6e Corrected comments on where settrace and setprofile are tested. 2010-07-25 15:05:42 +00:00
Alexander Belopolsky 13c475385b Issue #9315: Renamed test_trace to test_sys_settrace and
test_profilehooks to test_sys_setprofile so that test_trace can be
used for testing the trace module and for naming consistency.
2010-07-25 15:02:55 +00:00
Alexander Belopolsky f6d2ca06ac Issue #9315: Revert r83005 before renaming test_trace to
test_sys_settrace and test_profilehooks to test_sys_setprofile in all
three branches.
2010-07-25 14:58:54 +00:00
Ronald Oussoren cb615e6abe Fix for issue 9367: the test code for os.getgroups
assumes that the result of getgroups and the output
of the id(1) command return groups in the same
order.  That assumption is both fragile and false.
2010-07-24 14:15:19 +00:00
Victor Stinner eccc5facd3 Issue #4629: getopt raises an error if an argument ends with = whereas getopt
doesn't except a value (eg. --help= is rejected if getopt uses ['help='] long
options).
2010-07-24 00:49:20 +00:00
Alexander Belopolsky cf86e368eb Issue #7989: Added pure python implementation of the datetime module. 2010-07-23 19:25:47 +00:00
Brett Cannon 671153db25 Add queue tests for empty, full, put_nowait, and get_nowait.
Closes issue 9357. Thanks to Brian Brazil for the patch.
2010-07-23 16:56:21 +00:00
Brian Curtin 81a4a6abb7 Tab test_repr_daemon over so it's included in ThreadTests.
Noticed by Amaury.
2010-07-23 16:30:10 +00:00
Brett Cannon 4b16e130cc Add tests for fnmatch.filter and translate.
Partially closes issue 9356. Thanks to Brian Brazil for the patch.
2010-07-23 16:23:13 +00:00
Richard Jones 8cb3619f86 New tests for smtpd module. Has full coverage for SMTPChannel and SMTPServer. 2010-07-23 16:20:40 +00:00
Brett Cannon 3f5f226ba0 Add more tests for the threading.Thread.repr.
Partially closes issue 9346. Thanks to Brian Brazil for the patch.
2010-07-23 15:50:52 +00:00
Brett Cannon 42e54b29b9 Stop shadowing a test class. 2010-07-23 14:45:19 +00:00
Brett Cannon 1f27479e26 Explicitly test relative imports by reusing importlib tests.
Closes issue 8392. Thanks Virgil Dupras for the initial patch.
2010-07-23 14:03:16 +00:00
Brett Cannon cfae36fa8e Test calendar.monthrange.
Closes issue 9342. Thanks John Chandler for the patch.
2010-07-23 13:54:14 +00:00
Ronald Oussoren b6ee4f5bfc This fixes issue7900 by adding code that deals
with the fact that getgroups(2) might return
more that MAX_GROUPS on OSX.

See the issue (and python-dev archives) for the
gory details. Summarized: OSX behaves rather oddly
and Apple says this is intentional.
2010-07-23 13:53:51 +00:00
Martin v. Löwis c9e1c7d97f Issue #6095: Make directory argument to os.listdir optional.
Patch by Virgil Dupras.
2010-07-23 12:16:41 +00:00
Ronald Oussoren e186e384f4 Fix for issue 7895. Avoid crashing the interpreter
when calling platform.mac_ver after calling os.fork by
reading from a system configuration file instead of
using OSX APIs.
2010-07-23 11:54:59 +00:00
Ronald Oussoren c3960c28b0 Minor tweak of test_osx_env to
avoid failing when the framework is not
yet installed.
2010-07-23 11:48:36 +00:00
Ronald Oussoren 102d11a6d6 Workaround for issue 4047: in some configurations of
the Crash Reporter on OSX test_subprocess will trigger
the reporter.

This patch prints a warning when the Crash Reporter will
get triggered intentionally, which should avoid confusing
people.
2010-07-23 09:50:05 +00:00
Brian Curtin db902ac0b4 Skip this test as it doesn't apply to Windows. It was added for
#9189 for some GCC flags.
2010-07-22 15:38:28 +00:00
Antoine Pitrou 8cb6dbf1b9 Issue #5395: check that array.fromfile() re-raises an IOError instead of replacing it
with EOFError.
(this is only an added test, but 2.x will get a fix too)
2010-07-21 16:41:31 +00:00
Benjamin Peterson 20f9c3c50f revert unintended changes 2010-07-20 22:39:34 +00:00
Benjamin Peterson 013783c529 move test_trace.py so as not to conflict with future tests for the trace module 2010-07-20 22:37:19 +00:00
Gregory P. Smith 41e6c3df8b Fixes Issue #3704: http.cookiejar was not properly handling URLs with a / in
the parameters.  (This is jjlee's issue3704.patch ported to py3k)
2010-07-19 23:17:22 +00:00
Senthil Kumaran 79e17f6f66 Fix Issue9301 - urllib.parse.unquote and unquote_to_byte to raise TypeError for None. 2010-07-19 18:17:19 +00:00
Stefan Krah 99212f61db Sub-issue of #9036: Fix incorrect use of Py_CHARMASK. 2010-07-19 17:58:26 +00:00
Stefan Krah 9542cc6eb5 Issue #9265: Incorrect name passed as arg[0] when shell=True
and executable specified.
2010-07-19 14:20:53 +00:00
Ronald Oussoren f4ebe2e8a0 This patch adds a testcase that demonstrates a problem
with the expansion of LDSHARED when accessing that value
through sysconfig.

The problem is probably caused by the 9189.

A fix will follow shortly.
2010-07-19 13:00:36 +00:00
Alexander Belopolsky d92f04062a Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x
python when they contain instances of old-style classes.
2010-07-17 22:50:45 +00:00
Antoine Pitrou 448acd0a3f Fix possible failure in pickling tests due to different instantiations
of the random module being around.
2010-07-16 19:10:38 +00:00
Antoine Pitrou 1f9dea0b5f Issue #9251: test_threaded_import didn't fail when run through regrtest
if the import lock was disabled.
2010-07-14 11:52:38 +00:00
Senthil Kumaran aa69d4d00f Fix Issue5842 - Moving the tests out of urllib.parse module 2010-07-14 10:21:22 +00:00
Victor Stinner 996903120c Woops, test_sndhdr.py contains the same code twice: fix it 2010-07-13 23:08:01 +00:00
Victor Stinner e9ebde48cf Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee. 2010-07-13 23:04:56 +00:00
Alexander Belopolsky 903396ee66 Set sys.modules[name] to None instead of 0 to block module import. 2010-07-13 14:50:16 +00:00
Mark Dickinson 94628eeb58 Yield more information on failure in test_struct boolean test. 2010-07-12 20:03:24 +00:00
Benjamin Peterson 5ef96e5fac allow byte literals 2010-07-11 23:06:06 +00:00
Mark Dickinson 68c5de6d1c assertEquals -> assertEqual 2010-07-11 19:12:10 +00:00
Mark Dickinson b214e90e01 Issue #9137: Fix issue in MutableMapping.update, which incorrectly
treated keyword arguments called 'self' or 'other' specially.
2010-07-11 18:53:06 +00:00
Mark Dickinson 8e0c996873 Issue #9165: Add math.isfinite and cmath.isfinite. 2010-07-11 17:38:24 +00:00
Benjamin Peterson 3e7428995f test for set literals 2010-07-11 12:59:24 +00:00
Senthil Kumaran 2ef16328e8 Stricter verification for file based url scheme and reliance on ftp protocol. 2010-07-11 03:12:43 +00:00
Benjamin Peterson 0d62f5bbfe ValueError is eventually what we want to move to, I suppose 2010-07-10 15:14:45 +00:00
R. David Murray 0425a8ea72 Fix 'refleak' introduced by fnmatch cache purge tests.
This introduces a 'purge' function for the fnmatch module analogous
to the 'purge' function in the re module.
2010-07-10 13:52:13 +00:00
Georg Brandl 0310a83e7f #3071: tell how many values were expected when unpacking too many. 2010-07-10 10:32:36 +00:00
Benjamin Peterson b669221bd1 be more robust across platforms 2010-07-09 19:37:00 +00:00
Brian Curtin 74e4561a3c Re-flow several long lines from #1578269. 2010-07-09 15:58:59 +00:00
Brian Curtin 16633fa497 Fix the breakage of Lib/tarfile.py on non-Windows platforms due to
using WindowsError in a try/except. Only add WindowsError to the list of
exceptions to catch when we are actually running on Windows.

Additionally, add a call that was left out in test_posixpath.

Thanks Amaury, Antoine, and Jason.
2010-07-09 13:54:27 +00:00
Benjamin Peterson 4b83af9576 wrap 2010-07-09 13:31:11 +00:00
Benjamin Peterson a04a32d586 allow more exceptions 2010-07-09 13:28:42 +00:00
Benjamin Peterson ccbcf53865 OverflowError is fine 2010-07-09 13:20:40 +00:00
R. David Murray ea340a317a 7846: limit fnmatch pattern cache to _MAXCACHE=100 entries.
Patch by Andrew Clegg.
2010-07-09 12:23:21 +00:00
Benjamin Peterson 8b0ef21c15 use assert method 2010-07-09 01:58:26 +00:00
Benjamin Peterson d02441ea2f fix repr of complicated structseqs #9206 2010-07-08 22:33:03 +00:00
Benjamin Peterson 8c567c540d assert tuple inheritance 2010-07-08 22:16:05 +00:00
Brian Curtin 808e1ada94 Undo inadvertant checkin. 2010-07-08 22:13:25 +00:00
Brian Curtin d40e6f70a5 Implement #1578269. Patch by Jason R. Coombs.
Added Windows support for os.symlink when run on Windows 6.0 or greater,
aka Vista. Previous Windows versions will raise NotImplementedError
when trying to symlink.

Includes numerous test updates and additions to test_os, including
a symlink_support module because of the fact that privilege escalation
is required in order to run the tests to ensure that the user is able
to create symlinks. By default, accounts do not have the required
privilege, so the escalation code will have to be exposed later (or
documented on how to do so). I'll be following up with that work next.

Note that the tests use ctypes, which was agreed on during the PyCon
language summit.
2010-07-08 21:39:08 +00:00