Commit graph

21474 commits

Author SHA1 Message Date
Stefano Rivera 338d54f0a5 bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules (GH-1766)
[Issue 28401](https://bugs.python.org/issue28401): Don't attempt to import the stable API extensions, they are not supported in PyDEBUG builds (which don't implement that ABI).


https://bugs.python.org/issue28401
2018-11-16 15:52:52 -08:00
Terry Jan Reedy b65413b497
bpo-35213: Where appropriate, use 'macOS' in idlelib. (#10478) 2018-11-15 13:15:13 -05:00
Julien Palard 64313478bc
bpo-32613: Update window FAQ (GH-5552) 2018-11-14 16:22:27 +01:00
Gregory P. Smith 746b2d35ea
bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506)
Discovered using clang's MemorySanitizer when it ran python3's
test_fstring test_misformed_unicode_character_name.

An msan build will fail by simply executing: ./python -c 'u"\N"'
2018-11-13 13:16:54 -08:00
Eddie Elizondo 474eedfb3d bpo-34784: Fix PyStructSequence_NewType with heap-allocated StructSequence (GH-9665) 2018-11-13 13:09:31 +01:00
Victor Stinner 1a6be91e6f
bpo-35081: Make some _PyGC macros internal (GH-10507)
* Move "GC" macros together:

  * PyObject_IS_GC()
  * _Py_AS_GC()
  * _PyObject_GC_IS_TRACKED()
  * _PyObject_GC_MAY_BE_TRACKED()

* Mark other GC macros as internal (#ifdef Py_BUILD_CORE):

  * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p)
  * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p)
  * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g)
  * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o)
  * _PyObject_GC_TRACK(o), _PyObject_GC_UNTRACK(o)
  * _PyGC_PREV_MASK_FINALIZED
  * _PyGC_PREV_MASK_COLLECTING
  * _PyGC_PREV_SHIFT
  * _PyGC_PREV_MASK

* Replace _PyGC_generation0 with _PyRuntime.gc.generation0
* _queuemodule.c: replace _PyObject_GC_UNTRACK()
  with with PyObject_GC_UnTrack()
* Document that  _PyObject_GC_TRACK() _PyObject_GC_UNTRACK() macros
  have been removed from the public C API.
2018-11-13 12:52:18 +01:00
Victor Stinner 2c07c493d2
bpo-29564: warnings suggests to enable tracemalloc (GH-10486)
The warnings module now suggests to enable tracemalloc if the source
is specified, tracemalloc module is available, but tracemalloc is not
tracing memory allocations.
2018-11-13 02:41:00 +01:00
Gregory P. Smith 1584a00815
bpo-35214: Initial clang MemorySanitizer support (GH-10479)
Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.

Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that.  This lets our build succeed under the memory sanitizer.  not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.
2018-11-12 12:07:14 -08:00
Andrew Svetlov 7438792607
bpo-30064: Refactor sock_* asyncio API (#10419) 2018-11-12 19:00:22 +02:00
Giampaolo Rodola 19c46a4c96
bpo-33695 shutil.copytree() + os.scandir() cache (#7874) 2018-11-12 06:18:15 -08:00
Terry Jan Reedy 50ff02b431
bpo-34864: Document two IDLE on MacOS issues. (GH-10456)
The System Preferences Dock "prefer tabs always" setting disables some
IDLE features.  Menus are a bit different than as described for Windows
and Linux.
2018-11-10 23:26:31 -05:00
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) 43a74abb3a bpo-35202: Remove unused imports in idlelib (GH-10438) 2018-11-10 01:45:31 -05:00
Lisa Roach 0f221d09ca
bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) 2018-11-08 18:34:33 -08:00
Gregory P. Smith 49fa4a9f1e
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.

Do a bounds check within find_op so it can return before going past the end as a safety measure.

7db3c48833 (diff-a33329ae6ae0bb295d742f0caf93c137)
introduced this off by one error while fixing another one nearby.

This bug was shipped in all Python 3.6 and 3.7 releases.

The included unittest won't fail unless you do a clang msan build.
2018-11-08 17:55:07 -08:00
Vincent Michel fd512d7645 bpo-35065: Remove StreamReaderProtocol._untrack_reader (#10212)
The call to `_untrack_reader` is performed too soon, causing the protocol
to forget about the reader before `connection_lost` can run and feed the
EOF to the reader. See bpo-35065.
2018-11-08 14:21:47 +02:00
Serhiy Storchaka a44d34e179
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Pydoc now does not duplicate docstrings for aliases of inherited methods.
2018-11-08 08:48:11 +02:00
Pablo Galindo 6843ffe453
Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403)
This reverts commit c64583b6d3 due to multiple buildbot failures when building it.
2018-11-07 23:55:40 +00:00
Elvis Pranskevichus a6e956bcb0 bpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327)
Current support for hash-based bytecode files in `zipimport` is rather
sparse, which leads to test failures when the test suite is ran with
the ``SOURCE_DATE_EPOCH`` environment variable set.

This teaches zipimport to handle hash-based pycs properly.
2018-11-07 20:34:59 +02:00
samstagern c64583b6d3 bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)
Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.

We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.
2018-11-07 16:49:14 +00:00
Cheryl Sabella 637a33b996 bpo-2504: Add pgettext() and variants to gettext. (GH-7253) 2018-11-07 16:12:20 +02:00
Diego Rojas 5598cc90c7 bpo-34160: Preserve order of attributes in minidom. (GH-10219) 2018-11-07 16:09:04 +02:00
HongWeipeng f194479949 bpo-31553: add --json-lines option to json.tool (#10051)
* add jsonlines option to json.tool

* code review

* fix:avoid read infile after it close

* improve doc in whatsnew 3.8
2018-11-07 12:09:32 +02:00
guoci 0e7497cb46 bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704)
Without setting mtime, time.time() will be used as the timestamp which will
end up in the compressed data and each invocation of the compress() function
will vary over time.
2018-11-07 11:50:23 +02:00
Terry Jan Reedy 76cd0c30d6
bpo-33000: Document that IDLE's shell has no line limit. (#10373)
A program that runs indefinitely can overfill memory.
2018-11-06 23:55:06 -05:00
Alexander Buchkovsky bccacd19fa bpo-17560: Too small type for struct.pack/unpack in mutliprocessing.Connection (GH-10305)
Allow sending more than 2 GB at once on a multiprocessing connection on non-Windows systems.
2018-11-06 20:38:34 +01:00
Terry Jan Reedy 75d9d59ab3
bpo-23220: Explain how IDLE's Shell displays output (GH-10356)
Add a new subsection to the doc.
2018-11-06 12:37:36 -05:00
Terry Jan Reedy 5e79090324
bpo-35099: Improve the doc about IDLE running user code. (#10350)
The section is renamed from "IDLE -- console differences".  It mostly
covers the implications of using custom sys.stdxxx objects.
2018-11-05 21:30:32 -05:00
Rémi Lapeyre 6531bf6309 bpo-33462: Add __reversed__ to dict and dict views (GH-6827) 2018-11-06 09:38:54 +09:00
Mario Corchero ad1a25f499 bpo-32512: Add -m option to profile for profiling modules (#5132)
The new option in the CLI of the profile module allow to profile
executable modules. This change follows the same implementation as the
one already present in `cProfile`.

As the argument is now present on both modules, move the tests to the
common test case to be run with profile as well.
2018-11-05 22:03:46 +10:00
Max Bélanger 2810dd7be9 closes bpo-32285: Add unicodedata.is_normalized. (GH-4806) 2018-11-04 15:58:24 -08:00
Julien Palard 5d236cafd7
bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614) 2018-11-04 23:40:32 +01:00
Stéphane Wirtel 55f3317e98 bpo-10536: Enhancements to gettext docs (GH-10324) 2018-11-04 23:24:41 +01:00
Lysandros Nikolaou 59668aa8b7 bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) 2018-11-04 16:21:28 -05:00
Stéphane Wirtel 3e28eed9ec bpo-34969: Add --fast, --best on the gzip CLI (GH-9833) 2018-11-03 16:24:23 +01:00
BNMetrics b942707fc2 bpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101)
Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted.
2018-11-02 11:20:19 -04:00
Max Bélanger 318ab63c01 closes bpo-35139: The pyexpat module's macros in Modules/Setup now match setup.py (GH-10289)
This could cause compile errors on macOS or other platforms.
2018-11-01 19:49:46 -07:00
Christopher Thorne ac22f6aa98 bpo-33578: Add getstate/setstate for CJK codec (GH-6984)
This implements getstate and setstate for the cjkcodecs multibyte incremental encoders/decoders, primarily to fix issues with seek/tell.

The encoder getstate/setstate is slightly tricky as the "state" is pending bytes + MultibyteCodec_State but only an integer can be returned. The approach I've taken is to encode this data into a long, similar to how .tell() encodes a "cookie_type" as a long.


https://bugs.python.org/issue33578
2018-11-01 03:48:49 -07:00
Xiang Zhang b08746bfdf
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
2018-10-31 19:49:16 +08:00
Serhiy Storchaka 0353b4eaaf
bpo-33138: Change standard error message for non-pickleable and non-copyable types. (GH-6239) 2018-10-31 02:28:07 +02:00
Serhiy Storchaka 3f819ca138
bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) 2018-10-31 02:26:06 +02:00
Serhiy Storchaka b232df9197
bpo-31680: Add curses.ncurses_version. (GH-4217)
Use curses.ncurses_version for conditionally skipping a test.
2018-10-30 13:22:42 +02:00
Serhiy Storchaka 3e429dcc24
bpo-33237: Improve AttributeError message for partially initialized module. (GH-6398) 2018-10-30 13:19:51 +02:00
Serhiy Storchaka 95b6acf951
bpo-34876: Change the lineno of the AST for decorated function and class. (GH-9731)
It was overridden by the lineno of the first decorator. Now it is
the lineno of 'def' or 'class'.
2018-10-30 13:16:02 +02:00
Serhiy Storchaka c93c58b5d5
bpo-33331: Clean modules in the reversed order in PyImport_Cleanup(). (GH-6565)
Modules imported last are now cleared first at interpreter shutdown.

A newly imported module is moved to the end of sys.modules, behind
modules on which it depends.
2018-10-29 19:30:16 +02:00
Terry Jan Reedy ea9c8bd443
bpo-35097: Add IDLE doc subsection explaining editor windows. (#10206)
Topics include opening, title and status bar, .py* extension, and running.
2018-10-28 20:42:18 -04:00
Petter Strandmark 47d94241a3 bpo-35047, unittest.mock: Better error messages on assert_called_xxx failures (GH-10090)
unittest.mock now includes mock calls in exception messages if
assert_not_called, assert_called_once, or assert_called_once_with
fails.
2018-10-28 21:37:10 +01:00
Terry Jan Reedy 18032632ab
Issue 35093: Document the IDLE document viewer in the IDLE doc. (#10195)
Add a paragraph in "Help and preferences", "Help sources" subsection.
2018-10-28 16:21:18 -04:00
Pablo Galindo 372d705d95
bpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846)
The list() constructor isn't taking full advantage of known input
lengths or length hints. This commit makes the constructor
pre-size and not over-allocate when the input size is known (the
input collection implements __len__). One on the main advantages is
that this provides 12% difference in memory savings due to the difference
between overallocating and allocating exactly the input size.

For efficiency purposes and to avoid a performance regression for small
generators and collections, the size of the input object is calculated using
__len__ and not __length_hint__, as the later is considerably slower.
2018-10-28 20:16:26 +00:00
Raymond Hettinger e3685fd5fd
bpo-34160: Preserve user specified order of Element attributes (GH-10163) 2018-10-28 11:18:22 -07:00
Sebastian Rittau c8a8d6b347 bpo-35089: Don't mention typing.io and typing.re (GH-10173)
https://bugs.python.org/issue35089
2018-10-28 16:03:29 +00:00