Commit Graph

43332 Commits

Author SHA1 Message Date
Michael Felt 7ef1697be5 bpo-34347: Fix test_utf8_mode.test_cmd_line for AIX (GH-8923)
AIX uses ISO-8859-1 encoding for the C locale.
2018-08-27 15:40:17 +02:00
Serhiy Storchaka 7d81e8f599
bpo-26544: Get rid of dependence from distutils in platform. (GH-8356) 2018-08-27 13:29:51 +03:00
Serhiy Storchaka b44a1d4f71
bpo-34171: Fix test_trace. (GH-8940)
Remove "trace.cover" left from previous test runs before testing
that it is no longer created.
2018-08-27 13:10:36 +03:00
Elias Zamaria 393f1ff62e bpo-32968: Make modulo and floor division involving Fraction and float consistent with other operations (#5956)
Make mixed-type `%` and `//` operations involving `Fraction` and `float` objects behave like all other mixed-type arithmetic operations: first the `Fraction` object is converted to a `float`, then the `float` operation is performed as normal. This fixes some surprising corner cases, like `Fraction('1/3') % inf` giving a NaN.

Thanks Elias Zamaria for the patch.
2018-08-27 07:59:28 +01:00
Michael Felt 89d79b1449 Remove AIX workaround test_subprocess (GH-8939)
An old apparent AIX behavior workaround in test_subprocess's
test_undecodable_env is no longer needed.
2018-08-26 10:29:36 -07:00
Sergey Fedoseev 86b89916d1 Fix upsizing of marks stack in pickle module. (GH-8860)
Previously marks stack was upsized even there was space for additional item.
2018-08-25 10:54:40 +03:00
Serhiy Storchaka c406d5cd74
bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841) 2018-08-25 10:27:55 +03:00
Gregory P. Smith 76be0fffff
bpo-13312: Avoid int underflow in time year. (GH-8912)
Avoids an integer underflow in the time module's year handling code.
2018-08-24 18:08:50 -07:00
Vladimir Matveev 91cb298f81 bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (GH-8864) 2018-08-24 17:18:00 +03:00
Paul Ganssle 096329f0b2 bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)
The current C implementations **crash** if the input includes a surrogate
Unicode code point, which is not possible to encode in UTF-8.

Important notes:

1.  It is possible to pass a non-UTF-8 string as a separator to the
    `.isoformat()` methods.
2.  The pure-Python `datetime.fromisoformat()` implementation accepts
    strings with a surrogate as the separator.

In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators,
this implementation will take a performance hit by making a copy of the
input string and replacing the separator with 'T'.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Co-authored-by: Paul Ganssle <paul@ganssle.io>
2018-08-23 18:06:20 +03:00
Michael Osipov 48ce4897f8 bpo-34412: Make signal.strsignal() work on HP-UX (GH-8786)
Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL for
signalmodule.c. Add some common signals on HP-UX. This change applies for
Windows and HP-UX.
2018-08-23 16:27:19 +03:00
Grant Jenks 65bef36f0b Remove superseded line from argparse.HelpFormatter() (GH-8839) 2018-08-22 23:14:14 +03:00
Berker Peksag e7d4b2f205
bpo-2122: Make mmap.flush() behave same on all platforms (GH-8692)
Previously, its behavior was platform-dependent and there was no error checking
under Windows.
2018-08-22 21:21:05 +03:00
Alexey Izbyshev cdbf50cba1 bpo-34441: Fix ABC.__subclasscheck__ crash on classes with invalid __subclasses__ (GH-8835)
The missing NULL check was reported by Svace static analyzer.
2018-08-20 23:04:19 +03:00
Serhiy Storchaka 77d5781835
bpo-34318: Convert deprecation warnings to errors in assertRaises() etc. (GH-8623) 2018-08-19 10:00:11 +03:00
Zackery Spytz e349bf2358 bpo-22602: Raise an exception in the UTF-7 decoder for ill-formed sequences starting with "+". (GH-8741)
The UTF-7 decoder now raises UnicodeDecodeError for ill-formed
sequences starting with "+" (as specified in RFC 2152).
2018-08-19 07:43:38 +03:00
Vinay Sajip d3d3171da8
bpo-34415: Updated logging.Formatter docstring. (GH-8811) 2018-08-19 05:14:19 +01:00
davidair 2b32da2fea Improve error message when mock.assert_has_calls fails (GH-8205)
This makes the assertion error message more useful, aiding debugging.

Thanks @davidair!
2018-08-17 12:09:58 -07:00
Christian Heimes 1590c39336
bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)
Read from data socket to avoid "[SSL] shutdown while in init" exception
during shutdown of the dummy server.

Signed-off-by: Christian Heimes <christian@python.org>


<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
https://bugs.python.org/issue34391
<!-- /issue-number -->
2018-08-16 19:43:44 +02:00
Berker Peksag e0b5b2096e
bpo-34384: Fix os.readlink() on Windows (GH-8740)
os.readlink() now accepts path-like and bytes objects on Windows.
Previously, support for path-like and bytes objects was only
implemented on Unix.

This commit also merges Unix and Windows implementations of
os.readlink() in one function and adds basic unit tests to increase
test coverage of the function.
2018-08-15 13:03:41 +03:00
Christian Heimes 88bfd0bce0
bpo-34399: 2048 bits RSA keys and DH params (#8762)
Downstream vendors have started to deprecate weak keys. Update all RSA keys
and DH params to use at least 2048 bits.

Finite field DH param file use RFC 7919 values, generated with

    certtool --get-dh-params --sec-param=high

Signed-off-by: Christian Heimes <christian@python.org>
2018-08-14 12:54:19 +02:00
Benjamin Peterson aa4e4a40db
Make regular expressions in test_tasks.py raw strings. (GH-8759)
Follow up to bpo-34270.

Fixes:
```
Lib/test/test_asyncio/test_tasks.py:330: DeprecationWarning: invalid escape sequence \d
  match1 = re.match("^<Task pending name='Task-(\d+)'", repr(t1))
Lib/test/test_asyncio/test_tasks.py:332: DeprecationWarning: invalid escape sequence \d
  match2 = re.match("^<Task pending name='Task-(\d+)'", repr(t2))
```
2018-08-13 21:32:30 -07:00
Raymond Hettinger 00414597b4
Add more tests and assertions for math.hypot() and math.dist() (GH-8747) 2018-08-12 12:15:23 -07:00
Vadim Pushtaev 4d12e4dc28 bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452) 2018-08-12 07:46:05 -04:00
Berker Peksag c8b0dbc492
bpo-26818: Add a test to make sure the bug is fixed (GH-8664)
The main cause of this bug was fixed as part of bpo-31908.
2018-08-11 09:15:43 +03:00
Berker Peksag 84a13fbda0
bpo-9372: Deprecate several __getitem__ methods (GH-8609)
The __getitem__ methods of DOMEventStream, FileInput,
and FileWrapper classes ignore their 'index' parameters
and return the next item instead.
2018-08-11 09:05:04 +03:00
Berker Peksag 423d05f6f5
bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663) 2018-08-11 08:45:06 +03:00
Tal Einat 077059e0f0
bpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678) 2018-08-10 09:02:08 +03:00
GPery b92c526ed5 closes bpo-34353: Add sockets to stat.filemode fallback python implementation. (GH-8703) 2018-08-09 22:12:08 -07:00
Alex Grönholm cca4eec3c0 bpo-34270: Make it possible to name asyncio tasks (GH-8547)
Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
2018-08-08 17:06:47 -04:00
Benjamin Peterson 52dee687af
Assume the raw environ is always declared. (GH-8707)
posixmodule.c always declares environ, so don't bother catching a NameError in os.py.
2018-08-07 21:51:12 -07:00
Berker Peksag e4dcbbd7f4
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634) 2018-08-07 05:12:18 +03:00
Serhiy Storchaka 8f7bb100d0
bpo-34272: Move argument parsing tests from test_capi to test_getargs2. (GH-8567) 2018-08-06 16:50:19 +03:00
Anthony Sottile b2499669ef bpo-19891: Ignore error while writing history file (GH-8483) 2018-08-06 17:28:19 +09:00
Tal Einat 87e59ac11e
bpo-33839: refactor IDLE's tooltips & calltips, add docstrings and tests (GH-7683)
* make CallTip and ToolTip sub-classes of a common abstract base class
* remove ListboxToolTip (unused and ugly)
* greatly increase test coverage
* tested on Windows, Linux and macOS
2018-08-05 09:21:08 +03:00
Stefan Otte 46dc4e34ed bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655) 2018-08-03 23:49:42 +03:00
Marcel Plch 7b41dbad78 bpo-34325: Skip zipfile test for large timestamps when filesystem don't support them. (GH-8656)
When the filesystem doesn't support files with large timestamps,
skip testing that such files can be zipped.
2018-08-03 17:59:19 +02:00
INADA Naoki 2ebd3813af
Fix docstring of Profiler class (GH-8651) 2018-08-03 18:09:57 +09:00
Terry Jan Reedy 9beaef6225
bpo-34275: Make IDLE calltips always visible on Mac. (GH-8639)
Some MacOS-tk combinations need .update_idletasks().
The call is both unneeded and innocuous on Linux and Windows.
Patch by Kevin Waltzer.
2018-08-02 22:50:01 -04:00
Victor Stinner 5640d030e1 bpo-30317: Fix multiprocessing test_timeout() (GH-8621)
Multiprocessing test_timeout() now accepts a delta of 100 ms instead
of just 50 ms, since the test failed with 135.8 ms instead of the
expected 200 ms.
2018-08-03 01:09:00 +01:00
torsava f394ee5eaf bpo-27910: Update documentation of traceback module (GH-6116)
In the documentation for the traceback module, the definitions of functions
extract_tb(), format_list() and classmethod StackSummary.from_list()
mention the old style 4-tuples that these functions used to return or accept.

Since Python 3.5, however, they return or accept a FrameSummary object
instead of a 4-tuple, or a StackSummary object instead of a list of 4-tuples.

Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
2018-08-02 19:08:59 +03:00
Marcel Plch a2fe1e52eb bpo-34097: Add support for zipping files older than 1980-01-01 (GH-8270)
ZipFile can zip files older than 1980-01-01 and newer than 2107-12-31 using
a new strict_timestamps parameter at the cost of setting the timestamp
to the limit.
2018-08-02 15:04:52 +02:00
Tal Einat dd74369cb7
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616) 2018-08-02 10:30:06 +03:00
Tal Einat 10ea9409ce
bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
Added missing .grab_release() calls to all places where we call .grab_set().
2018-08-02 09:18:29 +03:00
Victor Stinner ea68d83933
bpo-34170: _PyCoreConfig_Read() defaults to argc=0 (GH-8595)
Add unit tests for argc and argv of _PyCoreConfig.
2018-08-01 03:07:18 +02:00
Victor Stinner 9851227382
bpo-34170: Rename _PyCoreConfig.unbuffered_stdip (GH-8594)
* Rename _PyCoreConfig.unbuffered_stdio to buffered_stdio
* Rename _PyCoreConfig.debug to parser_debug
2018-08-01 03:07:00 +02:00
Victor Stinner b75d7e2435
bpo-34170: Add _PyCoreConfig._frozen parameter (GH-8591)
Modify frozenmain.c to use _Py_InitializeFromConfig().
2018-08-01 02:13:04 +02:00
costypetrisor 8ed317f1ca bpo-34113: Fix a crash when using LLTRACE is on (GH-8517)
Fix a crash on negative STACKADJ() when Low-Level trace (LLTRACE) is enabled.
2018-07-31 22:55:14 +02:00
MartinAltmayer 944451cd8d bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532) 2018-07-31 10:06:12 -04:00
Raymond Hettinger 9c18b1ae52
bpo-33089: Add math.dist() for computing the Euclidean distance between two points (GH-8561) 2018-07-31 00:45:49 -07:00