Commit Graph

21462 Commits

Author SHA1 Message Date
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
Terry Jan Reedy 2b555fc1f0
bpo-35088: Update idlelib.help.copy_string docstring (#10164)
We now use git and backporting instead of hg and forward merging.
2018-10-28 01:29:00 -04:00
Terry Jan Reedy db40cb50eb
bpo-35087: Update idlelib help files for the current doc build. (GH-10162)
There is only one trivial change to idle.rst. Nearly all the changes to help.html are the elimination of chapter and section numbers on headers due to changes in the build system. help.py no longer requires header numbering.
2018-10-28 01:21:36 -04:00
jdemeyer aeb1be5868 bpo-34751: improved hash function for tuples (GH-9471) 2018-10-27 20:06:38 -04:00
Steve Dower 53125a53f4
bpo-35067: Remove _distutils_findvs and use vswhere.exe instead. (GH-10095) 2018-10-27 16:48:33 -04:00
Serhiy Storchaka fec35c99aa
bpo-33710: Deprecate l*gettext() and related functions in the gettext module. (GH-10139)
They return encoded bytes and are Python 2 artifacts.
2018-10-27 08:00:41 +03:00
Terry Jan Reedy d9bff4e81b
bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)
Specify that blocks are non-overlapping. Change '!=' to '<'.
2018-10-26 23:03:08 -04:00
Stéphane Wirtel 12e696b4f0 bpo-35042: Use the :pep: role where a PEP is specified (#10036) 2018-10-26 15:58:26 -07:00
Quentin Agren 9e14e49f13 bpo-35024: Remove redundant and possibly incorrect verbose message after writing '.pyc' (GH-9998)
Since `SourceFileLoader.set_data()` catches exceptions raised by `_write_atomic()` and logs an informative message consequently, always logging successful outcome in 'SourceLoader.get_code()' seems redundant.  



https://bugs.python.org/issue35024
2018-10-26 11:36:30 -07:00
Andrés Delfino a6dc531063 bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576) 2018-10-26 17:56:57 +03:00
Denis Ledoux 10cb3760e8 bpo-35017, socketserver: don't accept request after shutdown (GH-9952)
Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.
2018-10-26 15:46:17 +02:00
Victor Stinner a05bef4f5b
bpo-35059, PCbuild: Expand inline funcs in Debug (GH-10094)
Visual Studio solution: Set InlineFunctionExpansion to
OnlyExplicitInline ("/Ob1" option) on all projects (in
pyproject.props) in Debug mode on Win32 and x64 platforms to expand
functions marked as inline.

This change should make Python compiled in Debug mode a little bit
faster on Windows. On Unix, GCC uses -Og optimization level for
./configure --with-pydebug.
2018-10-26 15:10:29 +02:00
Pablo Galindo 7cd2543416
bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903)
inspect.isfunction() processes both inspect.isfunction(func) and
inspect.isfunction(partial(func, arg)) correctly but some other functions in the
inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction)
lack this functionality. This commits adds a new check in the mentioned functions
in the inspect module so they can work correctly with arbitrarily nested partial
functions.
2018-10-26 12:19:14 +01:00