Carl Meyer
d658deac60
bpo-21145: Add cached_property decorator in functools ( #6982 )
...
Robust caching of calculated properties is
harder than it looks at first glance, so add
a solid, well-tested implementation to the
standard library.
2018-08-28 17:11:56 +10:00
Przemysław Spodymek
216b745eaf
bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)
2018-08-27 14:33:45 -07:00
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
Louis Sautier
3fe89dac42
bpo-34434: Update doc for bool(), float() and int() arguments (GH-8834)
2018-08-27 18:45:26 +08: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
Raymond Hettinger
74734f73ca
Fast path for exact floats in math.hypot() and math.dist() (GH-8949)
2018-08-26 19:38:31 -05: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
Alexey Izbyshev
a2eefa6754
bpo-34503: Fix refleak in PyErr_SetObject() (GH-8934)
2018-08-27 00:31:25 +08:00
Alexey Izbyshev
b57b4ac042
closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)
...
Reported by Svace static analyzer.
2018-08-25 16:52:27 -07:00
Alexey Izbyshev
5f79b50763
closes bpo-34501: PyType_FromSpecWithBases: Check spec->name before dereferencing it. (GH-8930)
...
Reported by Svace static analyzer.
2018-08-25 11:53:47 -07:00
Alexey Izbyshev
44838be9f7
closes bpo-34502: Remove a note about utf8_mode from sys.exit() docs. (GH-8928)
2018-08-25 11:23:00 -07:00
Zackery Spytz
1871a4a351
Remove unneeded PyErr_Clear() in _winapi_SetNamedPipeHandleState_impl() (GH-8281)
2018-08-26 01:10:14 +08:00
Andrés Delfino
2e5d2ea208
Fix markup in stdtypes documentation (GH-8905)
2018-08-25 07:08:20 -07:00
Sergey Fedoseev
90555eca44
bpo-34395: Don't free allocated memory on realloc fail in load_mark() in _pickle.c. (GH-8788)
2018-08-25 13:41:58 +03: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
Alexey Izbyshev
8fdd331bbf
closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin() (GH-8911)
2018-08-25 00:15:23 -07:00
Alexander Vasin
416cbce22d
Fixed typo with asynccontextmanager code example (GH-8845)
...
`yield conn`, instead of just `yield`.
2018-08-24 19:38:11 -07:00
Danish Prakash
09efe49c07
bpo-34426: fix typo (__lltrace__ -> __ltrace__) (GH-8822)
2018-08-24 19:00:25 -07: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
Alexey Izbyshev
eb746dbae8
bpo-34492: Python/coreconfig.c: Fix _Py_wstrlist_copy() (GH-8910)
...
bpo-34492: Python/coreconfig.c: Add missing NULL check to _Py_wstrlist_copy().
Fix _Py_wstrlist_clear() call on a wrong list.
Reported by Svace static analyzer.
2018-08-25 01:34:56 +02:00
Michael Osipov
3738fadc67
bpo-34448: Improve output of usable wchar_t check (GH-8846)
2018-08-24 19:17:19 +03:00
Alexey Izbyshev
498845368f
closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results. (GH-8869)
...
Reported by Svace static analyzer.
2018-08-24 08:53:16 -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
Daniel Dương
075b3c3259
Fix typo in the dataclasses's doc (GH-8896)
2018-08-24 05:19:24 -04:00
Alexey Izbyshev
7ecae3ca0b
closes bpo-34468: Objects/rangeobject.c: Fix an always-false condition in range_repr() (GH-8880)
...
Also, propagate the error from PyNumber_AsSsize_t() because we don't care
only about OverflowError which is not reported if the second argument is NULL.
Reported by Svace static analyzer.
2018-08-23 21:39:45 -07:00
Alexey Izbyshev
2b824b2538
closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in builtin_sum_impl() (GH-8872)
...
Reported by Svace static analyzer.
2018-08-23 21:27:52 -07:00
Alexey Izbyshev
f6247aac08
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
...
Reported by Svace static analyzer.
2018-08-23 21:22:16 -07:00
Anthony Sottile
cc18258daf
Fix doc for `add_subparsers` arguments (GH-8884)
...
There was a missing comma.
2018-08-23 20:08:54 -07:00
Jelle Zijlstra
b8a181f4ae
Fix typo in asyncio.BoundedSemaphore docs (GH-8882)
...
semapthores -> semaphores
2018-08-23 18:50:00 -07: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
Ville Skyttä
c33bb5d401
Make it more clear that setUpClass runs before each class, not "class run" (GH-8844)
2018-08-23 07:49:18 -07: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
Victor Stinner
89487f51b8
bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868)
...
bpo-34170, bpo-34207: pymain_read_conf() now sets Py_UTF8Mode to
config->utf8_mode. pymain_read_conf() calls indirectly
Py_DecodeLocale() and Py_EncodeLocale() which depend on Py_UTF8Mode.
2018-08-23 12:23:46 +02:00
Alexey Izbyshev
ccd9975267
bpo-34436: Fix check that disables overallocation for the last fmt specifier (GH-8826)
...
Reported by Svace static analyzer.
2018-08-23 09:50:52 +02:00
Grant Jenks
65bef36f0b
Remove superseded line from argparse.HelpFormatter() (GH-8839)
2018-08-22 23:14:14 +03:00
Alexey Izbyshev
c583919ffc
bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863)
...
Reported by Svace static analyzer.
2018-08-22 21:27:32 +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
28853a249b
bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)
...
Reported by Svace static analyzer.
2018-08-22 07:55:16 +03:00
Alexey Izbyshev
f8c06b0280
bpo-34456: pickle: Add missing NULL check to save_global(). (GH-8851)
...
Reported by Svace static analyzer.
2018-08-22 07:51:25 +03:00
Berker Peksag
ef8861c112
Fix Doc/whatsnew/3.8.rst (GH-8848)
...
The entry about deprecation of __getitem__ methods of
several classes was placed in the wrong section.
2018-08-21 17:58:49 +03:00
Zackery Spytz
3e26e42c90
bpo-34400: Fix more undefined behavior in parsetok.c (GH-8833)
2018-08-20 20:11:40 -07: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
Xiang Zhang
4c8555773a
bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744)
2018-08-20 22:36:19 +08:00
Alexey Izbyshev
74a307d48e
bpo-34435: Add missing NULL check to unicode_encode_ucs1(). (GH-8823)
...
Reported by Svace static analyzer.
2018-08-19 21:52:04 +03:00
Berker Peksag
225b055480
bpo-22057: Clarify eval() documentation (GH-8812)
...
If a globals dictionary without a '__builtins__' key is passed to
eval(), a '__builtins__' key will be inserted to the dictionary:
>>> eval("print('__builtins__' in globals())", {})
True
(As a result of this behavior, we can use the builtins
print() and globals() even if we passed a dictionary without a
'__builtins__' key to eval().)
2018-08-19 13:25:33 +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