Commit Graph

7151 Commits

Author SHA1 Message Date
Benjamin Peterson d285bdb443 start banging on zipfile's file leakiness 2010-10-31 17:57:22 +00:00
Benjamin Peterson d6868b4ed4 fix leaking sockets 2010-10-31 17:34:34 +00:00
Benjamin Peterson d094efd8b7 cleanup resources in test_smtplib #10264 2010-10-31 17:15:42 +00:00
Antoine Pitrou f569826f06 Issue #10266: uu.decode didn't close in_file explicitly when it was given
as a filename.  Patch by Brian Brazil.
2010-10-31 16:04:14 +00:00
Antoine Pitrou e974571d36 Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou. 2010-10-31 15:26:04 +00:00
Antoine Pitrou 64474542eb PY_CFLAGS doesn't exist under Windows 2010-10-31 11:34:47 +00:00
Kristján Valur Jónsson f53a626073 issue 10237
After increasing the default timeout for the barrier, the unittest for the default timeout must be adjusted
2010-10-31 03:00:57 +00:00
Benjamin Peterson cc221b2411 close some more files 2010-10-31 02:06:21 +00:00
Benjamin Peterson 5dc8fabb01 context managerify 2010-10-31 01:44:49 +00:00
Benjamin Peterson aa7cec0ac4 close file properly 2010-10-31 01:35:53 +00:00
Benjamin Peterson 556c7355dd use addCleanup 2010-10-31 01:35:43 +00:00
Benjamin Peterson ebe5d8ae3b patch up leaking fds 2010-10-31 01:30:11 +00:00
Benjamin Peterson d8fc2e1aeb this test manages the fds itself 2010-10-31 01:19:53 +00:00
Brian Curtin 61d0d60e13 Fix ResourceWarning for an unclosed socket.
test_return_header_keep_alive - Added a cleanup call for the socket.
2010-10-31 00:34:23 +00:00
Brian Curtin 076623bf0a Fix ResourceWarning. Use context manager to properly close file. 2010-10-31 00:03:45 +00:00
Brian Curtin 3ddcaafbbf Fix ResourceWarning about unclosed file 2010-10-30 23:56:45 +00:00
Benjamin Peterson e048797991 close open file from find_module() 2010-10-30 23:06:57 +00:00
Benjamin Peterson 1c87e2943a condense 2010-10-30 23:04:49 +00:00
Benjamin Peterson 0bbf9c99d6 kill pointless function imports 2010-10-30 23:01:58 +00:00
Benjamin Peterson 1a7127f6df remove useless assignment 2010-10-30 23:00:54 +00:00
Benjamin Peterson 807a5a1652 close files properly 2010-10-30 22:59:37 +00:00
Brian Curtin 9f5f65c736 Fix #10258 - clean up resource warning 2010-10-30 21:35:28 +00:00
Brian Curtin 810921b675 Fix #10257. Clear resource warnings by using os.popen's context manager. 2010-10-30 21:24:21 +00:00
Brian Curtin 1d7878a696 Fix #10256 - resource warning 2010-10-30 21:03:18 +00:00
Antoine Pitrou b6751dcff2 Issue #10250: fix resource warnings in test_urllib2_localnet. Patch by Brian Brazil. 2010-10-30 17:33:22 +00:00
Antoine Pitrou 8d2b51b46a Issue #10253: FileIO leaks a file descriptor when trying to open a file
for append that isn't seekable.  Patch by Brian Brazil.
2010-10-30 16:19:14 +00:00
Antoine Pitrou 849e12bfe9 Fix resource warning in test_unicodedata. Patch by Brian Brazil. 2010-10-30 14:24:33 +00:00
Antoine Pitrou a6e9502ab9 Fix resource warning in test_file. Patch by Brian Brazil. 2010-10-30 14:22:43 +00:00
Vinay Sajip b046b807fa Remove ResourceWarnings caused by files left open. 2010-10-30 09:50:18 +00:00
Kristján Valur Jónsson 6b6dffdc73 issue 10237
Increase the default timout of the barries used in the barrier tests.  This should solve unexpected timeouts on some machines.
2010-10-30 05:15:42 +00:00
Brett Cannon c524692c88 Properly close a file in test_minidom. 2010-10-30 00:14:59 +00:00
Brett Cannon 653238a88d Silence some ResourceWarning in test_mailbox by using file context managers.
Also call super().tearDown() where appropriate.
2010-10-30 00:13:00 +00:00
Antoine Pitrou d05f9ad302 Windows can't remove a file before it is closed 2010-10-29 23:55:55 +00:00
Brett Cannon 0174368449 Move test_linecache over to file context managers. 2010-10-29 23:55:51 +00:00
Brett Cannon dff69853af Use a file context manager for test_ioctl. 2010-10-29 23:54:28 +00:00
Brett Cannon 5a9e91b050 Silence ResourceWarning when testing that the file destructor closes the file. 2010-10-29 23:53:03 +00:00
Antoine Pitrou e1eca4e3f5 Issue #10233: Close file objects in a timely manner in the tarfile module
and its test suite.
2010-10-29 23:49:49 +00:00
Brett Cannon 749afa95ce Move test_imp over to file context managers. 2010-10-29 23:47:23 +00:00
Brett Cannon 105df5d75b Move test_httpservers over to file context managers. 2010-10-29 23:43:42 +00:00
Antoine Pitrou d2eca37cc5 Clean up socket closing in test_ssl and test.ssl_servers 2010-10-29 23:41:37 +00:00
Brett Cannon 77b7de6d18 Move test_httplib over to file context managers. 2010-10-29 23:31:11 +00:00
Brett Cannon 7f462fc835 Fix file closing in test_http_cookiejar. 2010-10-29 23:27:39 +00:00
Brett Cannon 918e2d4832 Clean up socket closing in test_ftplib. 2010-10-29 23:26:25 +00:00
Brett Cannon c0eee315f5 Properly close files in test_dbm_dumb. 2010-10-29 22:49:14 +00:00
Brett Cannon 5ede149342 Properly close a test file in test_cprofile. 2010-10-29 22:47:04 +00:00
Brett Cannon 2d562f8081 have test_asyncore properly close files. 2010-10-29 22:40:44 +00:00
Benjamin Peterson 54ad0beae0 set literals and unions are our friends 2010-10-29 21:33:10 +00:00
Benjamin Peterson 65c66ab255 make gdb skip expected 2010-10-29 21:31:35 +00:00
Antoine Pitrou 2b40efdfe8 Fix typo 2010-10-29 19:36:37 +00:00
Antoine Pitrou c14efc4e80 Make a GC run before trying to clean up files left over by
the latest test run.
2010-10-29 19:34:45 +00:00
Antoine Pitrou 83432babfd Issue #7547: fix transient failures due to network glitches in test_timeout.
Patch by Sandro Tosi.
2010-10-29 18:15:33 +00:00
Antoine Pitrou aa8796598a Actually restore the original asyncore socket map by making a copy of the dict 2010-10-29 11:54:38 +00:00
Antoine Pitrou 31e08a4df6 Make check_warnings error messages more informative 2010-10-29 11:54:03 +00:00
Antoine Pitrou a0d2f4def9 test___all__ ignores ResourceWarning as well 2010-10-29 11:53:34 +00:00
Antoine Pitrou 5efe9d0865 Fix ResourceWarning in Lib/test/threaded_import_hangers.py 2010-10-29 11:08:32 +00:00
Victor Stinner 14d8fe7de8 test_tarfile: woops, remove +0.001 which was used to debug 2010-10-29 11:02:06 +00:00
Victor Stinner 26bfb5ab82 test_tarfile: dump mtime as hexadecimal on test_extractall failure 2010-10-29 10:59:08 +00:00
Antoine Pitrou e033e06db0 Issue #10093: ResourceWarnings are now issued when files and sockets are
deallocated without explicit closing.  These warnings are silenced by
default, except in pydebug mode.
2010-10-29 10:38:18 +00:00
Lars Gustäbel 9cbdd75ec5 Add read support for all missing variants of the GNU sparse
extensions. Thus, in addition to GNUTYPE_SPARSE headers, sparse
information in pax headers created by GNU tar can now be decoded.
All three formats 0.0, 0.1 and 1.0 are supported.
On filesystems that support this, holes in files are now restored
whenever a sparse member is extracted.
2010-10-29 09:08:19 +00:00
Benjamin Peterson a95e977e41 decrement offset when it points to a newline (#10186 followup) 2010-10-29 03:28:14 +00:00
Victor Stinner 6f35eda4d9 Issue #10210: os.get_exec_path() ignores BytesWarning warnings 2010-10-29 00:38:58 +00:00
Victor Stinner bfd7b265b6 #10209, test_pep277: disable test_normalize and test_listdir on darwin
These tests are irrevelant on this OS.
2010-10-28 23:14:45 +00:00
Victor Stinner fc6f5a4020 test_pep277: disable filenames 11, 12, 13, 14 on darwin
Because darwin "normalizes" these filenames differently than Python's NFD
normalization.
2010-10-28 22:57:03 +00:00
Antoine Pitrou 07e20ef50b Issue #5437: A preallocated MemoryError instance should not hold traceback
data (including local variables caught in the stack trace) alive infinitely.
2010-10-28 22:56:58 +00:00
Georg Brandl 5be365f55d #10116: wrap transient_internet() around net access in test_urllib2net. 2010-10-28 14:55:02 +00:00
Victor Stinner 7362c4f311 test_pep277: add identifiers to filenames 2010-10-28 11:20:31 +00:00
Victor Stinner 7dae81b1ff test_pep277: format filename with ascii() on failure
"%a" instead of "%r"
2010-10-28 11:11:24 +00:00
Victor Stinner 74ad75405c test_pep277: format function argument with ascii() on failure
"%a" instead of "%r"
2010-10-28 11:09:09 +00:00
Kristján Valur Jónsson 3be00037d6 issue 8777
Add threading.Barrier
2010-10-28 09:43:10 +00:00
Georg Brandl 65ffae0aa3 Condition.wait now returns bool. 2010-10-28 09:24:56 +00:00
Georg Brandl b9a4391754 #10218: return timeout status from Condition.wait, mirroring other primitives' behavior. 2010-10-28 09:03:20 +00:00
Georg Brandl 4d54088599 #7351: add more consistent exception name alias. 2010-10-28 06:42:33 +00:00
Antoine Pitrou d72402effc Recode modules from latin-1 to utf-8 2010-10-27 18:52:48 +00:00
Antoine Pitrou 6b03ee6033 Issue #5027: The standard `xml` namespace is now understood by
xml.sax.saxutils.XMLGenerator as being bound to
http://www.w3.org/XML/1998/namespace.  Patch by Troy J. Farrell.
2010-10-27 18:33:30 +00:00
Georg Brandl 7424dd359c #5975: add unix_dialect to csv module. 2010-10-27 07:27:06 +00:00
Vinay Sajip 6a65c5df86 logging: Improved Formatter implementation. 2010-10-26 13:16:11 +00:00
Vinay Sajip a39c571061 logging: Added style option to Formatter to allow %, {} or himBHformatting. 2010-10-25 13:57:39 +00:00
Skip Montanaro 97019ff665 test_gdb should be skipped on darwin (not up to v7 yet) 2010-10-25 01:35:48 +00:00
Victor Stinner 2ebe697267 Issue #10161: test_pep277 formats filenames with ascii() on error
As suggested by Antoine, it's better to patch only test_pep277 than the
unittest module.
2010-10-24 21:05:03 +00:00
Georg Brandl 08be72d0aa Add a new warning gategory, ResourceWarning, as discussed on python-dev. It is silent by default,
except when configured --with-pydebug.

Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
2010-10-24 15:11:22 +00:00
Georg Brandl b75b639a8b Remove usage of exception indexing. 2010-10-24 14:20:22 +00:00
Nick Coghlan 543af75961 Issue 5178: Add tempfile.TemporaryDirectory (original patch by Neil Schemenauer) 2010-10-24 11:23:25 +00:00
Benjamin Peterson 503d6c5ae9 remove broken code accounting an offset the size of the line #10186 2010-10-24 02:52:05 +00:00
Martin v. Löwis 57f75799bf Revert r85801. The test ought to pass without rounding. 2010-10-23 19:02:30 +00:00
Antoine Pitrou fbb1c6191c Follow up to #9778: fix regressions on 64-bit Windows builds 2010-10-23 17:37:54 +00:00
Georg Brandl 1e908af335 #6518: enable context manager protocol for ossaudiodev types. 2010-10-23 17:31:52 +00:00
Antoine Pitrou 1cae8b58eb Also guard other SOCK_NONBLOCK test 2010-10-23 17:05:13 +00:00
Antoine Pitrou acd0fda1a4 Fix SOCK_CLOEXEC and SOCK_NONBLOCK tests on recent glibcs with old Linux kernels. 2010-10-23 17:01:44 +00:00
Victor Stinner 2b9af63b4f Try to fix test_tarfile on AMD64 debian parallel 3.x
tarinfo.mtime is an int, whereas getmtime() is a float and it might be
different by something like 3 µs.
2010-10-23 01:15:30 +00:00
Antoine Pitrou ff150f2921 Revert r85797 (and r85798): it broke the Windows buildbots because of
test_multiprocessing's misbehaviour.
2010-10-22 21:41:05 +00:00
Antoine Pitrou 7eecffd05d Issue #9935: Speed up pickling of instances of user-defined classes. 2010-10-22 19:43:59 +00:00
Antoine Pitrou eb585adbde Fix test_ssl on Ubuntu buildbot with patched OpenSSL 2010-10-22 18:24:20 +00:00
Antoine Pitrou d532321f7b Issue #5639: Add a *server_hostname* argument to `SSLContext.wrap_socket`
in order to support the TLS SNI extension.  `HTTPSConnection` and
`urlopen()` also use this argument, so that HTTPS virtual hosts are now
supported.
2010-10-22 18:19:07 +00:00
Georg Brandl 83938437cb #10166: rewrite self-recursion to iteration in pstats.Stats.add(). Also add a unittest and a stats test file. 2010-10-22 06:28:01 +00:00
Antoine Pitrou 9583cac633 Issue #10089: Add support for arbitrary -X options on the command-line.
They can be retrieved through a new attribute `sys._xoptions`.
2010-10-21 13:42:28 +00:00
Georg Brandl 50de5f56a9 #10159: sort completion matches before comparing to dir() result. 2010-10-21 07:40:03 +00:00
Victor Stinner f933e1ab6f Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment variable
is not set, the locale encoding is ISO-8859-1, whereas most programs (including
Python) expect UTF-8. Python already uses UTF-8 for the filesystem encoding and
to encode command line arguments on this OS.
2010-10-20 22:58:25 +00:00
Victor Stinner 073f759d65 Move non-ascii test from test_run_code() to a new function: test_non_ascii() 2010-10-20 21:56:55 +00:00
Victor Stinner f6211eda71 Move test_undecodable_code() from test_sys to test_cmd_line 2010-10-20 21:52:33 +00:00
Victor Stinner 6722b5f7f1 test_zipimport_support: use ascii() on bytes output to avoid BytesWarning
The test failed with python -bb.
2010-10-20 21:48:35 +00:00
Georg Brandl 9450cc056a Fix r85728: use "" to mean the system default locale, which should work on more systems. 2010-10-20 06:50:19 +00:00
Vinay Sajip 6dbed2e8b3 logging: Allowed filters to be just callables. 2010-10-19 20:53:01 +00:00
Vinay Sajip 6fac817136 logging: Added tests for _logRecordClass changes. 2010-10-19 20:44:14 +00:00
Georg Brandl 7004bd1a3d #10092: Properly reset locale in Locale*Calendar classes. The context manager was buggy because setlocale() returns the *new* locale, not the old. Also add a test for this. 2010-10-19 18:54:25 +00:00
Victor Stinner 9a90900da5 PyUnicode_FromFormatV(): Fix %A format
It was not completly implemented. Add a test.
2010-10-18 20:59:24 +00:00
Hirokazu Yamamoto b08820ad40 Issue #5117: Case normalization was needed on ntpath.relpath(). And
fixed root directory issue on posixpath.relpath(). (Ported working fixes
from ntpath)
2010-10-18 12:13:18 +00:00
R. David Murray a90032a3fb #1343: Add short_empty_elements option to XMLGenerator.
Patch and tests by Neil Muller.
2010-10-17 22:46:45 +00:00
Victor Stinner 6fb457526c test_httpservers: Python CGI scripts have to be encoded to utf-8
And not the locale encoding. With this commit, the test finally pass on Windows
with a non-ascii path :-)
2010-10-17 20:17:41 +00:00
Victor Stinner 3218c31429 test_httpservers: Fix skip test check, the python executable path have to be
encodable to utf-8, not to the file1 encoding.
2010-10-17 20:13:36 +00:00
Victor Stinner 0b0ca0c37e test_httpservers: skip CGI tests if Python executable path is not encodable 2010-10-17 19:46:36 +00:00
Senthil Kumaran ee2538beef Fix Issue10119 - test_urllibnet failure when using support.transient_internet. 2010-10-17 10:52:12 +00:00
Gregory P. Smith feedda2bab Avoid hanging the test on netbsd5. 2010-10-17 03:09:12 +00:00
Gregory P. Smith 0f61dd0787 skip test_itimer_virtual on NetBSD to prevent the test suite from hanging. 2010-10-17 02:57:19 +00:00
Victor Stinner e3874ed7dd test_cmd_line_script: format paths with ascii() instead of repr()
Fix the test if the native filesystem encoding is not utf-8 (eg. cp1250 on
Windows).
2010-10-17 01:41:09 +00:00
Benjamin Peterson ca9f128583 use assertion methods 2010-10-17 01:30:26 +00:00
Benjamin Peterson cb17094dcd disable the garbage collector while collecting traces, so that __del__s don't get caught 2010-10-17 01:29:11 +00:00
Benjamin Peterson fc49f2a973 remove rather pointless test 2010-10-17 01:25:19 +00:00
Gregory P. Smith b603d03f15 fix for netbsd. 2010-10-17 00:17:24 +00:00
Victor Stinner f6782ac0b6 test_subprocess: use surrogateescape error handler to write shell scripts
test_args_string() and test_call_string() create shell scripts including the
path to the Python executable: use surrogateescape to encode paths including
surrogate characters.
2010-10-16 23:46:43 +00:00
Victor Stinner 9d396399da Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a
new test specific to unicode (non-ascii name and filename).
2010-10-16 21:54:59 +00:00
Benjamin Peterson 230b20684f don't identify the toplevel namespace by name #9997 2010-10-16 03:45:45 +00:00
Barry Warsaw 8cf4eae522 First (uncontroversial) part of issue 9807.
* Expose the build flags to Python as sys.abiflags
* Shared library libpythonX.Y<abiflags>.so
* python-config --abiflags
* Make two distutils tests that failed with --enable-shared (even before this
  patch) succeed.
* Fix a few small style issues.
2010-10-16 01:04:07 +00:00
Georg Brandl b9cd72a9f7 #5762: fix handling of empty namespace in minidom, which would result in AttributeError on toxml(). 2010-10-15 17:58:45 +00:00
Alexander Belopolsky e8f583244a Issue #9308: Removed redundant coding cookies. Added tests for
importing encoded modules that do not depend on specific stdlib
modules being encoded in a certain way.
2010-10-15 16:28:20 +00:00
Georg Brandl 1f7fffb308 #2830: add html.escape() helper and move cgi.escape() uses in the standard library to it. It defaults to quote=True and also escapes single quotes, which makes casual use safer. The cgi.escape() interface is not touched, but emits a (silent) PendingDeprecationWarning. 2010-10-15 15:57:45 +00:00
Georg Brandl 91d2a3fb0e #5355 followup: add unit test for new dictionaries, and provide submodules from xml.parsers.expat as advertised. 2010-10-15 15:25:23 +00:00
Brian Curtin f668df5fa7 Fix #10098. Fix sporadic test_os failures.
Amaury noticed that we're not waiting for the subprocess to be ready --
it should be checking for 1, not 0.
2010-10-15 14:21:06 +00:00
Antoine Pitrou ba8071241b Revert debug printout 2010-10-15 13:52:53 +00:00
Antoine Pitrou fe9791365d Enable debug output at the start of the regression suite instead.
Sorry for the ephemeral inconvenience.
2010-10-15 13:47:00 +00:00
Antoine Pitrou f64317e05f Temporary debug printout for buildbots 2010-10-15 13:35:51 +00:00
Antoine Pitrou 92f60ed82a More proper closing of files 2010-10-14 22:11:44 +00:00
Florent Xicluna 35049443dc Add test case for issue #9409, non-ascii char in doctest. It passes in 3.2 but needs fixing in 2.7. 2010-10-14 21:35:58 +00:00
Antoine Pitrou b86680e299 Explicitly close some files (from issue #10093) 2010-10-14 21:15:17 +00:00
Florent Xicluna d9f57630fe Fix the regex to match all kind of filenames, for interactive debugging in doctests. (issue #9409) 2010-10-14 20:56:20 +00:00
Antoine Pitrou d778e568ba Increase timeouts in test_ftplib (for very slow buildbots) 2010-10-14 20:35:26 +00:00
Antoine Pitrou 8c8f1ac46c Oops 2010-10-14 18:32:54 +00:00
Antoine Pitrou b3a88b5c42 Really fix bug 2010-10-14 18:31:39 +00:00
Barry Warsaw 270800c801 Fix issue 10094, by narrowing down the test for PROXY environment variables.
Ubuntu 10.10 introduced $UBUNTU_MENUPROXY into the default user environment,
and that's what's tripping up the code.
2010-10-14 18:10:34 +00:00
Alexander Belopolsky 1bcbaab15a Issue 9183: Intern UTC timezone. 2010-10-14 17:03:51 +00:00
Antoine Pitrou 5bc4fa7a49 Replace the "compiler" resource with the more generic "cpu", so
as to mark CPU-heavy tests.
2010-10-14 15:34:31 +00:00
Antoine Pitrou b1c5496738 Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module,
where supported by the system.  Patch by Nikita Vetoshkin.
2010-10-14 15:05:38 +00:00
Senthil Kumaran 383c32dd38 Issue10063 - file:// scheme will stop accessing remote hosts via ftp protocol 2010-10-14 11:57:35 +00:00
Antoine Pitrou 1b03f2ca83 Inherit interpreter flags in parallel testing 2010-10-14 11:12:00 +00:00
Victor Stinner 89f3ad10d2 test_subprocess doesn't need to C locale to test os.environb
Improve also the comment to explain why C locale is needed to test os.environ.
2010-10-14 10:43:31 +00:00
Victor Stinner ebc78d23ef test_subprocess: use C locale to get ascii locale encoding 2010-10-14 10:38:17 +00:00
Georg Brandl f5247e35c1 #9964: fix running test_cmd_line_script under -O and -OO. 2010-10-14 08:08:56 +00:00
Georg Brandl 1463a3f833 #9964: fix running test_compileall under -O and -OO. 2010-10-14 07:42:27 +00:00
Georg Brandl 1c2a7b7a69 Better check for "any optimize option given". 2010-10-14 07:34:56 +00:00
Georg Brandl f99a15c377 #9964: fix running test_xml_etree under -OO. 2010-10-14 07:32:52 +00:00
Georg Brandl fb3c84a8d9 #9964: fix running test_import under -O or -OO. 2010-10-14 07:24:28 +00:00
Georg Brandl ebbf63b5b2 #9964: Fix failure of test_dis under -OO. 2010-10-14 07:23:01 +00:00
Georg Brandl 268e4d4cf3 #1710703: write zipfile structures also in the case of closing a new, but empty, archive. 2010-10-14 06:59:45 +00:00
Antoine Pitrou a62cbf7cce Fix (hopefully) occasional failures in test_threaded_import.
`done` could be released multiple times because of concurrent
execution.  We convert it to an Event, where calling set()
multiple times is not a problem.
2010-10-13 23:48:39 +00:00
Victor Stinner d24fc5d7c4 test_sys: Remove workaround #8611
It looks like it is no more needed: Python 3.2 is slowly able to support
non-ascii paths with an ascii locale.
2010-10-13 23:41:57 +00:00
Victor Stinner 8f6b6b0cc3 Issue #9992: Remove PYTHONFSENCODING environment variable. 2010-10-13 22:02:27 +00:00
Antoine Pitrou 6003ff7633 Protect test_smtpnet against connection failures 2010-10-13 17:14:16 +00:00
Antoine Pitrou 834bd81c51 Issue #10041: The signature of optional arguments in socket.makefile()
didn't match that of io.open(), and they also didn't get forwarded
properly to TextIOWrapper in text mode.  Patch by Kai Zhu.
2010-10-13 16:17:14 +00:00
Antoine Pitrou 48e00f3ab6 Use PROTOCOL_SSLv23 in the test HTTPS server, in an attempt to appease the old Gentoo buildbot 2010-10-13 12:06:43 +00:00
Antoine Pitrou 84fa4314ba Print out socket errors in HTTPS server thread 2010-10-13 11:51:05 +00:00
Antoine Pitrou 05d936d2ce Let test_ssl fail gracefully if ssl support is not available 2010-10-13 11:38:36 +00:00
Antoine Pitrou f26f87ef06 Run a simple HTTPS server when Lib/test/ssl_servers.py is run as __main__ 2010-10-13 11:27:09 +00:00
Antoine Pitrou 803e6d670c Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
urllib.request.urlopen now take optional arguments to allow for
server certificate checking, as recommended in public uses of HTTPS.
2010-10-13 10:36:15 +00:00
Brian Curtin d2e948d720 Implement #7944. Use `with` throughout the test suite. 2010-10-13 02:56:26 +00:00
Brian Curtin 2c3563f782 Implement #7944. Use `with` throughout the test suite. 2010-10-13 02:40:26 +00:00
Brian Curtin 5acec04db5 Implement #7944. Use `with` throughout the test suite. 2010-10-13 02:29:46 +00:00
Brian Curtin 28f96b5b26 Implement #7944. Use `with` throughout the test suite. 2010-10-13 02:21:42 +00:00
Benjamin Peterson 5c4bfc4af0 prefer clearing global objects to obscure module.__dict__ bugs #10068 2010-10-12 22:57:59 +00:00
Antoine Pitrou 04248a8d99 Issue #3873: Speed up unpickling from file objects which have a peek()
method.
2010-10-12 20:51:21 +00:00
Antoine Pitrou b0182c8ca5 Issue #10075: Add a session_stats() method to SSLContext objects. 2010-10-12 20:09:02 +00:00
Martin v. Löwis baecd7243a Upgrade to Unicode 6.0.0.
makeunicodedata.py: download all data files from unicode.org,
  switch to extracting Unihan data from zip file.
  Read linebreakprops and derivednormalizationprops even for
  old versions, even though they are not used in delta records.
test:unicode.py: U+11000 is now assigned, use U+14000 instead.
2010-10-11 22:42:28 +00:00
Antoine Pitrou 81564093a1 Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the
custom certificate and private key files used by SSL-related certs.
2010-10-08 23:06:24 +00:00
Antoine Pitrou d7931095d5 Add some debug output in verbose mode 2010-10-08 18:46:09 +00:00
Antoine Pitrou f51d8d3a2e Better Python spawning primitives in test.script_helper, for
easier writing of unit tests and better error reporting.
2010-10-08 18:05:42 +00:00
Antoine Pitrou 59fdd6736b Issue #1589: Add ssl.match_hostname(), to help implement server identity
verification for higher-level protocols.
2010-10-08 10:37:08 +00:00
Hirokazu Yamamoto 54c950f6b4 Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os) 2010-10-08 08:38:15 +00:00
Raymond Hettinger bc95973b51 Fix handling on negative numbers in ast.literal_eval(). 2010-10-08 00:47:45 +00:00
Brian Curtin afa88b5dac Fix #8584. Fix the skipping of a number of tests due to incorrect importing.
This undoes a previous attempt to fix some of the skips. Value and copy
come from sharedctypes rather than plain ctypes, and the test skipping is
then done at the class level rather than test-by-test.

There are zero skipped tests after the fix.
2010-10-07 01:12:19 +00:00
Antoine Pitrou 7980eaa98d Issue #9759: GzipFile now raises ValueError when an operation is attempted
after the file is closed.  Patch by Jeffrey Finkelstein.
2010-10-06 21:21:18 +00:00
Brian Quinlan 1e2ae4f054 Fixes 9903: test_concurrent_futures writes on stderr 2010-10-06 13:05:45 +00:00
Amaury Forgeot d'Arc b441554835 #2982 More test coverage for the pyexpat parser. 2010-10-05 23:14:47 +00:00
Éric Araujo 6108bf5ed0 Fix interaction of custom translation classes and caching (#9042) 2010-10-04 23:52:37 +00:00
Giampaolo Rodolà 977c707b42 Fix issue 6706: adds new handle_accepted() method to asyncore.dispatcher 2010-10-04 21:08:36 +00:00
Senthil Kumaran f580adee27 Remove the debugging print line from the test. 2010-10-04 05:42:58 +00:00
Senthil Kumaran 58d5dbf80b Fix Issue10012 - httplib headers, which are (sometimes mistakenly) int are explicitly cast to str (bytes - in py3k). 2010-10-03 18:22:42 +00:00
Senthil Kumaran 4271372a71 Fix Issue9272 - Change CGIHTTPServer to give the child program a copy of os.environ 2010-10-03 17:55:45 +00:00
Benjamin Peterson 970d1887c5 add a test and a note about metaclasses now being abcs 2010-10-02 17:55:47 +00:00
R. David Murray 8f7bcb3f85 Make the printing of sqlite version in verbose mode work with regrtest -w. 2010-10-02 13:29:13 +00:00
Victor Stinner 46c7b3b283 Issue #8670: Rename testcapi unicode test methods
* test_aswidechar() => unicode_aswidechar()
 * test_aswidecharstring() => unicode_aswidecharstring()
2010-10-02 11:49:31 +00:00
Victor Stinner ea3f305a25 Oops, revert unwanted _testcapi changes of r85174 2010-10-02 11:46:20 +00:00
Victor Stinner 749261e241 Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t 2010-10-02 11:25:35 +00:00
Victor Stinner 5593d8aeb4 Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE
and 32 bits wchar_t (eg. Linux in narrow build).
2010-10-02 11:11:27 +00:00
Victor Stinner 1c24bd0252 Issue #8870: PyUnicode_AsWideCharString() doesn't count the trailing nul character
And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
2010-10-02 11:03:13 +00:00
Benjamin Peterson aec5fd1397 type.__abstractmethods__ should raise an AttributeError #10006 2010-10-02 00:03:31 +00:00
Brian Curtin 9e88b5aeee Fix #10003. Add SIGBREAK to the set of valid signals on Windows.
This fixes a regression noticed by bzr, introduced by issue #9324.
2010-10-01 14:49:24 +00:00
Alexander Belopolsky 38e2996152 Issue #6608: time.asctime is now checking struct tm fields its input
before passing it to the system asctime.  Patch by MunSic Jeong.
2010-10-01 14:18:49 +00:00
Senthil Kumaran 0f476d49f8 Issue1491 - BaseHTTPServer incorrectly implements response code 100 2010-09-30 06:09:18 +00:00
Mark Dickinson c60371748b Issue #9599: Further accuracy tweaks to loghelper. For an integer n that's small enough to be converted to a float without overflow, log(n) is now computed as log(float(n)), and similarly for log10. 2010-09-29 19:06:36 +00:00
Mark Dickinson 0c0714f954 Add testcases from bug report #9980. 2010-09-29 18:41:54 +00:00
Victor Stinner 15d597a245 test_imp: getfilesystemencoding() cannot be None anymore
And the codec name is normalized.
2010-09-29 16:59:46 +00:00
Antoine Pitrou a5785b1524 Fix NNTP when there's a ".netrc" file 2010-09-29 16:19:50 +00:00
Antoine Pitrou 2620d81b7f Disable the usenetrc option when testing nntplib 2010-09-29 16:08:29 +00:00
Antoine Pitrou 69ab95105f Issue #9360: Cleanup and improvements to the nntplib module. The API
now conforms to the philosophy of bytes and unicode separation in Python 3.
A test suite has also been added.
2010-09-29 15:03:40 +00:00
Brian Curtin 926f0da582 Fix #9978. WINFUNCTYPE is from ctypes, not from ctypes.wintypes.
r85073 changed the importing in wintypes to not use *, so the previous
usage here became even more incorrect.
2010-09-29 14:51:42 +00:00
Antoine Pitrou c3ed2e7f83 Issue #9962: GzipFile now has the peek() method. 2010-09-29 10:49:46 +00:00
R. David Murray d68d4e8e42 Have test_sqlite print version info when run in verbose mode. 2010-09-29 01:22:20 +00:00
R. David Murray 11cabcf73d #7110: have regrtest print test failures and tracebacks to stderr not stdout.
Patch by Sandro Tosi.
2010-09-29 01:08:05 +00:00
Brian Curtin 1771b54bed Implement #8521. Added named argument handling to winreg's CreateKeyEx,
DeleteKeyEx, and OpenKeyEx.

Note that CKE and DKE are new functions for 3.2 so I didn't give them a
versionchanged because of the existing versionadded. OpenKeyEx already
existed so it gets a versionchanged tag.
2010-09-27 17:56:36 +00:00
Antoine Pitrou 6d7df63837 Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
received.  Now sendall() properly calls signal handlers if necessary,
and retries sending if these returned successfully, including on sockets
with a timeout.
2010-09-27 17:52:25 +00:00
Senthil Kumaran 42ef4b1f4c Fix Issue1595365 - Adding the req.headers after the un-redirect headers have
been added. This helps in accidental overwritting of User-Agent header to
default value. To preserve the old behavior, only headers not in unredirected
headers will be updated.
2010-09-27 01:26:03 +00:00
Alexander Belopolsky a847c81914 This should fix buildbot failure introduced by r84994 2010-09-24 22:04:22 +00:00
Antoine Pitrou a4024e2dd5 Make _kill_process more robust under Windows too (see issue #8432) 2010-09-24 18:57:01 +00:00
Alexander Belopolsky ff09ce211f Issue #9936: Fixed executable lines' search in the trace module. 2010-09-24 18:03:12 +00:00
Brian Curtin 0151b8edda LoginTests fails on a number of buildbots with different errors. Skip
it for now until a buildbot-safe solution comes up.
2010-09-24 13:43:43 +00:00
Antoine Pitrou 605c293031 Further tarfile / test_tarfile cleanup 2010-09-23 20:15:14 +00:00
Mark Dickinson b09a3d69a6 Issue #9930: Remove an unnecessary type check in wrap_binaryfunc_r;
this was causing reversed method calls like float.__radd__(3.0, 1) to
return NotImplemented instead of the expected numeric value.
2010-09-23 20:11:19 +00:00
Brian Curtin e8e4b3bfd6 #9808. Implement os.getlogin for Windows, completed by Jon Anglin.
The test is semi-dumb, it just makes sure something comes back since we
don't have a solid source to validate the returned login. We can't be 100%
sure that the USERNAME env var will always match what os.getlogin() returns,
so we don't make any specific assertion there.
2010-09-23 20:04:14 +00:00
Antoine Pitrou ab58b5f90e Try harder to fix test_tarfile under Windows buildbots 2010-09-23 19:39:35 +00:00
Antoine Pitrou 95f5560b46 Try to fix test_tarfile issues on Windows buildbots by closing file
objects explicitly instead of letting them linger on.
2010-09-23 18:36:46 +00:00
Antoine Pitrou 7b9698435d Issue #1675951: Allow GzipFile to work with unseekable file objects.
Patch by Florian Festi.
2010-09-23 16:22:51 +00:00
Hirokazu Yamamoto dda7fdf194 Skip estLoadWithUNC when UNC is not available. 2010-09-23 15:28:35 +00:00
Hirokazu Yamamoto b3b390d7b3 Issue #9868: locale was left changed after TestEnUSCollation#setUp raised
TestSkip exception.
2010-09-23 15:20:15 +00:00
Florent Xicluna d12a420acc Fix encoding for test case added in r84967. 2010-09-23 00:46:13 +00:00
Florent Xicluna 42d544505f Fix typo and add test case. 2010-09-22 22:35:38 +00:00
Barry Warsaw 31c604d3a7 Issue 9916: Add some missing errno symbols. 2010-09-22 20:58:04 +00:00
Daniel Stutzbach c944cfc793 Issue9131: Mark fragile test as CPython-specific 2010-09-21 21:08:09 +00:00
Antoine Pitrou 38425292fb Issue #9908: Fix os.stat() on bytes paths under Windows 7. 2010-09-21 18:19:07 +00:00
Alexander Belopolsky 3e62f78c4e Fixed microsecond rounding in python version of utcfromtimestamp 2010-09-21 16:30:56 +00:00
Vinay Sajip c84f016988 Added some methods to LoggerAdapter, and updated documentation. 2010-09-21 11:25:39 +00:00
Benjamin Peterson 26d64aeee4 rewrite nocaret test to not rely on a specific SyntaxError 2010-09-20 21:47:37 +00:00
Barry Warsaw 0646b4bb77 test_get_makefile_filename() is not compatible with Windows. 2010-09-20 19:12:07 +00:00
Barry Warsaw ebbef6fef2 Issue 9877: expose sysconfig.get_makefile_filename() in the public API. 2010-09-20 15:29:53 +00:00
Vinay Sajip b4a0809ad7 logging: Add hasHandlers() method to Logger. 2010-09-20 09:55:00 +00:00
Antoine Pitrou 3d8580f690 Try a more robust implementation of _kill_process 2010-09-20 01:33:21 +00:00
Antoine Pitrou 84e751a442 Try to fix buildbot failure (#9902) 2010-09-20 00:12:19 +00:00
Antoine Pitrou 7c08744f52 Make error more explicit in test_finalize_with_trace 2010-09-19 23:28:30 +00:00
Antoine Pitrou fedd481596 Try to make signal-sending tests in test_subprocess more robust on slow machines 2010-09-19 23:06:53 +00:00
Antoine Pitrou fb8db8f635 Try to fix test_subprocess on "x86 debian parallel 3.x" buildbot 2010-09-19 22:46:05 +00:00
Florent Xicluna eb19dce085 Issue #1686: Fix string.Template when overriding the pattern attribute. 2010-09-18 23:34:07 +00:00
Antoine Pitrou 98b46702d2 Issue #9854: SocketIO objects now observe the RawIOBase interface in
non-blocking mode: they return None when an operation would block (instead
of raising an exception).
2010-09-18 22:59:00 +00:00
Antoine Pitrou 8db3027e6a Issue #9895: speed up test_subprocess 2010-09-18 22:38:48 +00:00
Brian Quinlan 81c4d36928 Initial implementation of PEP 3148 2010-09-18 22:35:02 +00:00
Antoine Pitrou 679e0f2328 Issue #9894: Do not hardcode ENOENT in test_subprocess.
(GNU/Hurd is not dead)
2010-09-18 17:56:02 +00:00
Hirokazu Yamamoto f2dec8d6f1 In Python3000, Tkinter was renamed to tkinter. And print is now function. 2010-09-18 04:42:41 +00:00
Hirokazu Yamamoto 2cdacd7495 Added missing BaseTest.tearDown(self). Fixed refleak. 2010-09-18 03:54:32 +00:00
Vinay Sajip bc85d848f5 Temporarily commented out test which succeeds locally but fails on buildbots, while investigating. 2010-09-17 23:35:29 +00:00
Vinay Sajip 19ec67acf6 Issue #9441: logging: Improved test coverage for rotating file handlers. 2010-09-17 18:57:36 +00:00
Raymond Hettinger 35c87f2b8e Issue 9865: add __sizeof__ to OrderedDict. 2010-09-16 19:10:17 +00:00
Antoine Pitrou aee47561fc Relax test condition (fix failures on FreeBSD buildbots) 2010-09-16 15:04:49 +00:00
Antoine Pitrou 2e55fec14c Make testDefaults in test.test_socket.BasicSocketPairTest more reliable. 2010-09-14 21:24:25 +00:00
Antoine Pitrou 328ec7455f Issue #9854: The default read() implementation in io.RawIOBase now
handles non-blocking readinto() returning None correctly.
2010-09-14 18:37:24 +00:00
Antoine Pitrou 9e0b864ac0 Issue #1552: socket.socketpair() now returns regular socket.socket
objects supporting the whole socket API (rather than the "raw"
_socket.socket objects).
2010-09-14 18:00:02 +00:00
Antoine Pitrou a468adc76d Issue #9853: Fix the signature of SSLSocket.recvfrom() and
SSLSocket.sendto() to match the corresponding socket methods.
2010-09-14 14:43:44 +00:00
Antoine Pitrou 2ed94eb520 Do not print additional shutdown message when gc.DEBUG_SAVEALL is set 2010-09-14 09:48:39 +00:00
Vinay Sajip 8552d1fc8f Added test for QueueHandler. 2010-09-14 09:34:09 +00:00
Alexander Belopolsky e1b6a9ac99 Added files missed in r84780. Thanks, Florent. 2010-09-14 01:11:35 +00:00
Raymond Hettinger 98a5f3f838 Issue 9840: Add reprlib.recursive_repr(), a decorator for handling recursive calls to __repr__ methods. 2010-09-13 21:36:00 +00:00
Daniel Stutzbach 9f0cbf1c72 Issue #9213: Add index and count methods to range objects, needed to
meet the API of the collections.Sequence ABC.
2010-09-13 21:16:29 +00:00
Eric Smith e4d6317c87 Issue 7994: Make object.__format__() raise a PendingDeprecationWarning
if the format string is not empty. Manually merge r79596 and r84772
from 2.x.

Also, apparently test_format() from test_builtin never made it into
3.x. I've added it as well. It tests the basic format()
infrastructure.
2010-09-13 20:48:43 +00:00
Alexander Belopolsky d8642c3274 Removed debugging setting 2010-09-13 18:15:33 +00:00
Alexander Belopolsky 4d7701729c Issue #9315: Fix for the trace module to record correct class name
when tracing methods.  Unit tests. Patch by Eli Bendersky.
2010-09-13 18:14:34 +00:00
Florent Xicluna dc69e7217a Make test.regrtest.__file__ absolute, this was not always the case when running profile or trace, for example. (issue #9323) 2010-09-13 16:35:02 +00:00
Florent Xicluna a87b383ac1 Reenable test_ucs4 and remove some duplicated lines. 2010-09-13 02:28:18 +00:00
Antoine Pitrou 6464d5ffdc Issue #9837: The read() method of ZipExtFile objects (as returned by
ZipFile.open()) could return more bytes than requested.
2010-09-12 14:51:20 +00:00
Benjamin Peterson 0b9489d21d reenable test_nis on solaris #3402 2010-09-12 13:55:02 +00:00
Victor Stinner 4c7db315df Issue #9738, #9836: Fix refleak introduced by r84704 2010-09-12 07:51:18 +00:00
Raymond Hettinger dc08a143e0 Issue #9826: Handle recursive repr in collections.OrderedDict. 2010-09-12 05:15:22 +00:00
Victor Stinner ca6525afba Issue #9819: don't try to encode TESTFN_UNICODE on Windows
mbcs (Windows default filesystem encoding) is now strict by default, and
depending on the code page, TESTFN_UNICODE may not be encodable to bytes.

Remove also unused "encoded" argument from _do_directory() method.
2010-09-11 12:52:30 +00:00
Victor Stinner 1205f2774e Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on
a non-ASCII byte in the format string.

Document also the encoding.
2010-09-11 00:54:47 +00:00
Victor Stinner b4ba986a71 Issue #9402: pyexpat uses Py_DECREF() instead of PyObject_DEL()
Fix a crash if Python is compiled in pydebug mode.
2010-09-10 22:25:19 +00:00
Victor Stinner 3d75d0cc92 Issue #8603: Environ.data is now protected -> Environ._data
os.environ.data was a str dict in Python 3.1. In Python 3.2 on UNIX/BSD,
os.environ.data is now a bytes dict: mark it as protected to avoid confusion.
2010-09-10 22:18:16 +00:00
Victor Stinner 5b519e0201 Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
2010-09-10 21:57:59 +00:00
Amaury Forgeot d'Arc ba117ef7e9 #4617: Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block.  This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).

This sample was valid in 2.6, but fails to compile in 3.x without this change::

   >>> def f():
   ...     def print_error():
   ...        print(e)
   ...     try:
   ...        something
   ...     except Exception as e:
   ...        print_error()
   ...        # implicit "del e" here


This sample has always been invalid in Python, and now works::

   >>> def outer(x):
   ...     def inner():
   ...        return x
   ...     inner()
   ...     del x

There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
2010-09-10 21:39:53 +00:00
Amaury Forgeot d'Arc fe7b40533c The "if 1": trick seems cleaner that the one with regular expressions.
Use it here again.
2010-09-10 19:47:43 +00:00
Amaury Forgeot d'Arc dfa9b294fa Use the "if 1:" prefix so that quoted code appears nicely
nested inside the test suite.

def test_me():
    exec("""if 1:
        ...code...
        """)

No other change here.
2010-09-10 19:40:52 +00:00
Victor Stinner 8ce7df67de Issue #9819: fix TESTFN_UNENCODABLE for japanese code page 2010-09-10 11:19:59 +00:00
Daniel Stutzbach 460ff3dd1c Skip socket tests that require the network, if the network resource is not enabled 2010-09-09 21:17:58 +00:00
Antoine Pitrou 4c7c421944 Remove workaround 2010-09-09 20:40:28 +00:00
Antoine Pitrou e4a189274f Issue #9804: ascii() now always represents unicode surrogate pairs as
a single `\UXXXXXXXX`, regardless of whether the character is printable
or not.  Also, the "backslashreplace" error handler now joins surrogate
pairs into a single character on UCS-2 builds.
2010-09-09 20:30:23 +00:00
Antoine Pitrou ea99c5c949 Issue #9410: Various optimizations to the pickle module, leading to
speedups up to 4x (depending on the benchmark).  Mostly ported from
Unladen Swallow; initial patch by Alexandre Vassalotti.
2010-09-09 18:33:21 +00:00
Antoine Pitrou 350c7229be Use transient_internet() where appropriate in test_ssl
(svn.python.org is sometimes unavailable)
2010-09-09 13:31:46 +00:00
Antoine Pitrou 6e6cc830c4 Issue #9757: memoryview objects get a release() method to release the
underlying buffer (previously this was only done when deallocating the
memoryview), and gain support for the context management protocol.
2010-09-09 12:59:39 +00:00
Raymond Hettinger bad3c88094 Have pprint() respect the order in an OrderedDict. 2010-09-09 12:31:00 +00:00
Raymond Hettinger 44d7b6ad60 Add docstring to cmd.Cmd.do_help() 2010-09-09 03:53:22 +00:00
Giampaolo Rodolà b383dbb45e Fix issue 9794: adds context manager protocol to socket.socket so that socket.create_connection() can be used with the 'with' statement. 2010-09-08 22:44:12 +00:00
Antoine Pitrou 7c9cf01238 gdb: fix representation of non-printable surrogate pairs, and workaround
a bug in ascii().
2010-09-08 21:57:37 +00:00
Antoine Pitrou 783eea722b Issue #9707: Rewritten reference implementation of threading.local which
is friendlier towards reference cycles.  This change is not normally
visible since an optimized C implementation (_thread._local) is used
instead.
2010-09-07 22:06:17 +00:00
Antoine Pitrou 2673c5bf5e Also catch some gaierrors 2010-09-07 21:43:31 +00:00
Amaury Forgeot d'Arc 4b6fdf3852 #6394: Add os.getppid() support for Windows. 2010-09-07 21:31:17 +00:00
Antoine Pitrou 8bc09039ed Improve transient_internet() again to detect more network errors,
and use it in test_robotparser. Fixes #8574.
2010-09-07 21:09:09 +00:00
Antoine Pitrou 4b92b5fad3 Issue #9792: In case of connection failure, socket.create_connection()
would swallow the exception and raise a new one, making it impossible
to fetch the original errno, or to filter timeout errors.  Now the
original error is re-raised.
2010-09-07 21:05:49 +00:00
Antoine Pitrou a88c83cbab Issue #8574: better implementation of test.support.transient_internet().
Original patch by Victor.
2010-09-07 20:42:19 +00:00
Antoine Pitrou 5e38aae91b Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True,
and the passed buffer was exactly 1024 bytes long, the buffer wouldn't
be updated back after the system call.  Original patch by Brian Brazil.
2010-09-07 16:30:09 +00:00
Raymond Hettinger 7f7561ebfc Remove invalid test (it was supposed to fail on 64-bit machines.). 2010-09-07 15:38:33 +00:00
Raymond Hettinger c585eecfb0 Fix test that depends on a particular implementation of random.choice(). 2010-09-07 15:00:15 +00:00
Raymond Hettinger dc4872eefe Fix corner case for Random.choice() and add tests. 2010-09-07 10:06:56 +00:00
Raymond Hettinger 0515661314 Issues #7889, #9025 and #9379: Improvements to the random module. 2010-09-07 04:44:52 +00:00
Raymond Hettinger f763a728ad Document which part of the random module module are guaranteed. 2010-09-07 00:38:15 +00:00
Raymond Hettinger f45abc97bf Add method to OrderedDict for repositioning keys to the ends. 2010-09-06 21:26:09 +00:00
Brian Curtin 13a0db5ddb Fix some errors that #7566 introduced on non-Windows platforms due to
an ImportError. Rearranged the import, faked out the implementation when
the import fails, and reorganized a test that depends on Win32 behavior.
2010-09-06 19:46:17 +00:00
Antoine Pitrou 972ee13e03 Issue #5506: BytesIO objects now have a getbuffer() method exporting a
view of their contents without duplicating them.  The view is both readable
and writable.
2010-09-06 18:48:21 +00:00
Brian Curtin 6285774f06 Implement #7566 - os.path.sameopenfile for Windows.
This uses the GetFileInformationByHandle function to return a tuple of values
to identify a file, then ntpath.sameopenfile compares file tuples, which
is exposed as os.path.sameopenfile.
2010-09-06 17:07:27 +00:00
Brian Curtin c734b312cb Clean up the fix to #9324 with some of the suggestions raised on python-dev
in response to the original checkin.

Move the validation from the original loop into a switch statement,
and adjust a platform check in the tests.
2010-09-06 16:04:10 +00:00
Gregory P. Smith 13b55291ac hashlib has two new constant attributes: algorithms_guaranteed and
algorithms_avaiable that respectively list the names of hash algorithms
guaranteed to exist in all Python implementations and the names of hash
algorithms available in the current process.

Renames the attribute new in 3.2a0 'algorithms' to 'algorithms_guaranteed'.
2010-09-06 08:30:23 +00:00
Antoine Pitrou 0d739d7047 Issue #9293: I/O streams now raise `io.UnsupportedOperation` when an
unsupported operation is attempted (for example, writing to a file open
only for reading).
2010-09-05 23:01:12 +00:00
Éric Araujo 1138eba3df Fix accidental suppression in r84537 2010-09-05 18:59:49 +00:00
Éric Araujo 23eae8646c Make naming consistent 2010-09-05 18:43:07 +00:00
Raymond Hettinger 02566ec89f Adopt more descriptive attribute names as suggested on python-dev. 2010-09-04 22:46:06 +00:00
Antoine Pitrou 0049249d63 Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
descriptor is provided.  Patch by Pascal Chambon.
2010-09-04 20:53:29 +00:00
Antoine Pitrou d9107aaded Issue #9777: test_idna requires the "network" resource 2010-09-04 18:50:35 +00:00
Antoine Pitrou 3941a8fece Issue #1100562: Fix deep-copying of objects derived from the list and dict types.
Patch by Michele Orrù and Björn Lindqvist.
2010-09-04 17:40:21 +00:00
Antoine Pitrou e5a9101519 Issue #9581: Fix non-working PosixGroupsTester test case
(it only runs as root, which is why nobody bothered about the failure)
2010-09-04 17:32:06 +00:00
Fred Drake cc645b9a59 add consistent support for the vars and default arguments on all
configuration parser classes
(http://bugs.python.org/issue9421)
2010-09-04 04:35:34 +00:00
Florent Xicluna edf5f0ddc0 Strengthen BytesWarning tests. 2010-09-03 20:00:37 +00:00
Daniel Stutzbach 06a3c8ae82 fromfd exists on Windows now 2010-09-03 11:11:43 +00:00
Raymond Hettinger faf7b7f4ec Issue 8420: Fix obscure set crashers. 2010-09-03 10:00:50 +00:00
Fred Drake 8844441ae6 fix output from RawConfigParser.write and ConfigParser.write for None
values (http://bugs.python.org/issue7005)
(merged r84443 from the release27-mmaint branch, with changes to reflect
changes in Python 3)
2010-09-03 04:22:36 +00:00
Daniel Stutzbach 045b3ba184 Issue #9212: Added the missing isdisjoint method to the dict_keys and
dict_items views.  The method is required by the collections.Set ABC,
which the views register as supporting.
2010-09-02 15:06:06 +00:00
Antoine Pitrou e0793ba992 Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
2010-09-01 21:14:16 +00:00
Antoine Pitrou 1ce3eb5c5b Issue #8990: array.fromstring() and array.tostring() get renamed to
frombytes() and tobytes(), respectively, to avoid confusion.  Furthermore,
array.frombytes(), array.extend() as well as the array.array()
constructor now accept bytearray objects.  Patch by Thomas Jollans.
2010-09-01 20:29:34 +00:00
Antoine Pitrou fce7fd6426 Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding()
are now removed, since their effect was inexistent in 3.x (the default
encoding is hardcoded to utf-8 and cannot be changed).
2010-09-01 18:54:56 +00:00
Giampaolo Rodolà 8b7da623ce Fix issue #9711: raise ValueError is SSLConnection constructor is invoked with keyfile and not certfile. 2010-08-30 18:28:05 +00:00
Benjamin Peterson 33856de84d handle names starting with non-ascii characters correctly #9712 2010-08-30 14:41:20 +00:00
Benjamin Peterson e992a7da01 remove pointless coding cookie 2010-08-30 13:57:28 +00:00
Giampaolo Rodolà 4a656ebe05 dedent some lines in test_ssl so that they are actually executed 2010-08-29 22:50:39 +00:00
Giampaolo Rodolà cd9dfb919a in ssl tests rely on IOError.errno rather thanf IOError.strerror for better compatibility across platforms. 2010-08-29 20:56:56 +00:00
Giampaolo Rodolà 745ab3807e Fix issue issue9706: provides a better error handling for various SSL operations 2010-08-29 19:25:49 +00:00
Antoine Pitrou 1a9a9d5433 Issue #1868: Eliminate subtle timing issues in thread-local objects by
getting rid of the cached copy of thread-local attribute dictionary.
2010-08-28 18:17:03 +00:00
Mark Dickinson 64a38c0eb5 Issue #1512791: In setframerate method of Wave_write, round non-integral
inputs to the nearest integer.  Thanks Neil Tallim for the patch.
2010-08-28 17:22:16 +00:00
Benjamin Peterson 0e10206f2c basicsize and itemsize are Py_ssize_t #9688 2010-08-25 23:13:17 +00:00
Victor Stinner ef6ff662c9 Fix test_sys: set LC_ALL instead of LANG
LC_ALL is read before LANG to choose the locale encoding (LC_ALL, LANG and then
LC_CTYPE: use the first non empty variable).
2010-08-25 08:33:34 +00:00
Martin v. Löwis 112c0f3411 Issue #1027206: getnameinfo is now restricted to numeric addresses as input. 2010-08-25 07:38:15 +00:00
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