Commit Graph

13558 Commits

Author SHA1 Message Date
Serhiy Storchaka 5c2cb824f4 Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by
Tamás Bence Gedai.
2016-03-12 10:51:16 +02:00
Serhiy Storchaka 69b7f812fa Issue #15068: Got rid of excessive buffering in the fileinput module.
The bufsize parameter is no longer used.
2016-03-08 18:35:45 +02:00
Serhiy Storchaka 2d80fb3905 Issue #26486: Removed pickle test that doesn't work in 2.7 on 64-bit platform. 2016-03-08 11:04:22 +02:00
Martin Panter 20c8cd9974 Issue #26456: Force all child threads to terminate in TestForkInThread 2016-03-08 07:07:28 +00:00
Benjamin Peterson 4ddb44a1d0 properly use PyObject_CallMethod in dictview binary operations (closes #26478) 2016-03-03 22:05:36 -08:00
Raymond Hettinger 2ec5fd546f Document another recipe for itertools: all_equal(). Inspired by David Beazley. 2016-03-06 18:06:29 -08:00
Berker Peksag 87640b30ce Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls
Raise ValueError if algorithm is not MD5 or SHA.

Initial patch by Mathieu Dupuy.
2016-03-06 16:27:23 +02:00
Serhiy Storchaka 9e00088cc5 Issue #26167: Backported copy tests. 2016-03-06 15:03:16 +02:00
Serhiy Storchaka 7c033e60df Issue #26486: Backported some pickle tests from 3.x. 2016-03-06 09:05:47 +02:00
Martin Panter b6b1ab4fa8 Issue #26385: Cleanup NamedTemporaryFile if fdopen() fails, by SilentGhost 2016-02-29 00:31:38 +00:00
Martin Panter ef85a1ac15 Issue #22836: Keep exception reports sensible despite errors 2016-02-28 00:18:43 +00:00
Serhiy Storchaka ee7fe38d40 Issue #25801: Fixed resource warnings in test_zipfile64.
Patch by SilentGhost.
2016-02-25 12:55:19 +02:00
Martin Panter 098f6d0caa Issue #5824: Fix DatagramRequestHandler tests by binding the client socket 2016-02-24 04:45:33 +00:00
Martin Panter 39267c21cc Issue #22088: Clarify base-64 alphabets and which characters are discarded
* There are only two base-64 alphabets defined by the RFCs, not three
* Due to the internal translation, plus (+) and slash (/) are never discarded
* standard_ and urlsafe_b64decode() discard characters as well
2016-02-23 22:30:50 +00:00
Martin Panter 63d1f47b49 Issue #26309: Rewrite test in main thread and avoid race condition 2016-02-19 02:16:42 +00:00
Martin Panter ba8474b77d Issue #26309: Shut down SocketServer request if verify_request() is false
Based on patch by Aviv Palivoda.
2016-02-18 10:43:55 +00:00
Martin Panter 53ae0ba6e3 Issue #26304: Change "allows to <verb>" to "allows <verb>ing" or similar
The original form is incorrect grammar and feels awkward, even though the
meaning is clear.
2016-02-10 05:44:01 +00:00
Serhiy Storchaka 78a54c0311 Issue #25983: Added tests for multi-argument type(). 2016-02-08 20:27:52 +02:00
Martin Panter ade4097671 Issue #12923: Reset FancyURLopener's redirect counter even on exception
Based on patches by Brian Brazil and Daniel Rocco.
2016-02-04 06:01:35 +00:00
Serhiy Storchaka 71b71763c5 Issue #25945: Fixed bugs in functools.partial.
Fixed a crash when unpickle the functools.partial object with wrong state.
Fixed a leak in failed functools.partial constructor.
"args" and "keywords" attributes of functools.partial have now always types
tuple and dict correspondingly.
2016-02-02 18:45:59 +02:00
Martin Panter 886aba4737 Issue #26173: Separate bad cert file tests and client rejection test
Test test_wrong_cert() runs a server that rejects the client's certificate,
so ECONNRESET is reasonable in addition to SSLError. On the other hand, the
other three tests don't even need to run a server because they are just
testing the parsing of invalid certificate files.

This should fix intermittent failures on Windows where ECONNRESET was not
being caught.
2016-02-01 21:58:11 +00:00
Martin Panter fd8e8504e2 Issue #26173: Fix test_ssl confusion with non-existing cert and wrongcert.pem
Testing for a non-existing certificate file is already done in test_errors().
The wrongcert.pem test was originally testing behaviour with a mismatched
certificate.
2016-01-30 02:36:00 +00:00
Serhiy Storchaka 3ecb6ab993 Issue #26198: Added tests for string-related format units of PyArg_Parse*()
functions: "s", "s*", "s#", "t#", "z", "z*", "z#", "w", "w*", "w#", "u",
"u#", "es", "et", "es#", "et#" and "c".
2016-01-28 19:56:04 +02:00
Victor Stinner 7791165fb3 code_richcompare() now uses the constants types
Issue #25843: When compiling code, don't merge constants if they are equal but
have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now
correctly compiled to two different functions: f1() returns 1 (int) and f2()
returns 1.0 (int), even if 1 and 1.0 are equal.

Add a new _PyCode_ConstantKey() private function.
2016-01-22 12:33:12 +01:00
Serhiy Storchaka 9b5177c41a Issue #26147: xmlrpclib now works with unicode not encodable with used
non-UTF-8 encoding.
2016-01-20 10:33:51 +02:00
Benjamin Peterson dd171ead80 add space 2016-01-18 21:18:49 -08:00
Serhiy Storchaka 27d9c3d39f Issue #9006: Added tests for XML RPC with non-UTF-8 encoding. 2016-01-18 19:38:53 +02:00
Serhiy Storchaka 2f173fe26b Issue #21847: Fixed xmlrpclib and tests on Unicode-disabled builds. 2016-01-18 19:35:23 +02:00
Serhiy Storchaka 43beaebffb Issue #6500: Fixed infinite recursion in urllib2.Request.__getattr__(). 2016-01-18 10:35:40 +02:00
Martin Panter 2179b2e159 Issue #14771: Redirect GDB's stdin to avoid messing the terminal settings
Otherwise, GDB seems to affect the terminal's foreground process group,
interfering with test_ioctl, which does not expect the foreground process to
change during the test. This change also solves the problem of the tests
being stopped in the shell if test_gdb is run twice in parallel.
2016-01-16 05:07:35 +00:00
Martin Panter 71202bb053 Issue #25940: Use self-signed.pythontest.net in SSL tests
This is instead of svn.python.org, whose certificate recently expired, and
whose new certificate uses a different root certificate.

The certificate used at the pythontest server was modifed to set the "basic
constraints" CA flag. This flag seems to be required for test_get_ca_certs_
capath() to work.

Added the new self-signed certificate to capath with the following commands:

cp Lib/test/{selfsigned_pythontestdotnet.pem,capath/}
c_rehash -v Lib/test/capath/
c_rehash -v -old Lib/test/capath/
# Note the generated file names
cp Lib/test/capath/{selfsigned_pythontestdotnet.pem,0e4015b9.0}
mv Lib/test/capath/{selfsigned_pythontestdotnet.pem,ce7b8643.0}

When attempting to connect to port 444 on the new server, the resulting error
code is EHOSTUNREACH on Linux, and ETIMEDOUT on Windows.
2016-01-15 00:25:29 +00:00
Ezio Melotti 07f24c50e0 #7944: close files explicitly in test_tarfile (backport d560eece0857). 2016-01-13 22:21:21 +02:00
Ezio Melotti 8861b291f2 Convert test_tarfile to ASCII (backport c1ed490bd266). 2016-01-13 19:36:49 +02:00
Barry Warsaw 8da4023e20 Comment out another test that won't pass after reverting the picklability
regression.
2016-01-11 14:49:34 -05:00
Barry Warsaw 607965eb7e Comment out two tests that won't pass now after reverting the typeobject.c
change.  Also, as per further discussion, we'll just remove the regressing
code in typeobject.c
2016-01-11 14:44:59 -05:00
Berker Peksag e01859fb65 Issue #6500: Reverting fbea8ff8db5e since it broke tests 2016-01-06 03:08:12 +02:00
Berker Peksag 621d7fd583 Issue #6500: Fix "maximum recursion depth exceeded" error caused by Request.__getattr__() 2016-01-06 02:04:52 +02:00
Serhiy Storchaka ff41d456bc Make catched exceptions more specific and correct a comment. 2015-12-30 20:59:32 +02:00
Serhiy Storchaka b8e54dd806 Issue #22995: Instances of extension types with a state that aren't
subclasses of list or dict and haven't implemented any pickle-related
methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__,
or __getstate__), can no longer be pickled.  Including memoryview.
2015-12-30 20:43:29 +02:00
Serhiy Storchaka a3c2242461 Fixed sizeof tests for dict and type (they were passed by accident).
Added tests for dict views.
2015-12-20 11:40:00 +02:00
Serhiy Storchaka 0b72ae8e78 Create a file in SizeofTest only if needed. 2015-12-20 09:36:55 +02:00
Serhiy Storchaka e789038e0d Use correct PyGC_Head size in tests for issue #25421. 2015-12-19 22:49:29 +02:00
Serhiy Storchaka c06a6d0958 Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:07:48 +02:00
Martin Panter d77fe94b4e Issue #22088: Port base64 character ignoring doc and test from 857d9fe60169 2015-12-14 03:41:59 +00:00
Martin Panter 7b9e7ed59f Issue #25809: Skip testing platform-dependent French thousands separator 2015-12-12 06:53:34 +00:00
Benjamin Peterson 3c459de2c6 remove pointless keys() call 2015-12-05 20:52:43 -08:00
Benjamin Peterson f9d11e815a make consulting save_modules O(1) rather than O(n) 2015-12-05 00:29:56 -08:00
Martin Panter 7e59ce8b07 Issue #14285: Do not catch ImportError from __init__.py in runpy
Initialize package before calling get_loader() for __main__, so that we do
not incorrectly handle ImportError from __init__.py. When runpy is used from
the Python CLI, use an internal exception rather than ImportError, to avoid
catching an unexpected ImportError.

Also simplify message formatting: str() is redundant with %s.

Also fix test_dash_m_error_code_is_one() in test_cmd_line_script, which was
failing because the test package was not in the current directlry, rather
the desired ValueError.
2015-12-03 01:23:10 +00:00
Serhiy Storchaka ab68fcaee3 Issue #6478: _strptime's regexp cache now is reset after changing timezone
with time.tzset().
2015-12-03 22:20:45 +02:00
Serhiy Storchaka e37003e9ae Issue #19543: Added Py3k warning for decoding unicode. 2015-12-03 20:47:48 +02:00