Commit Graph

80783 Commits

Author SHA1 Message Date
Miss Islington (bot) 6042f462cf
Linkify PEP 8 in unix.rst (GH-10482)
(cherry picked from commit 9404e7737b)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-12 08:52:13 -08:00
Andrés Delfino fb8eb2c277 [2.7] bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252) (GH-10469)
https://bugs.python.org/issue33699
(cherry picked from commit b086c8afdb)



https://bugs.python.org/issue33699
2018-11-11 12:09:03 -08:00
Alexey Izbyshev 0d165262d9 [2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433)
This typo doesn't affect the result because wrong bits are discarded
on implicit conversion to unsigned char, but it trips UBSan
with -fsanitize=implicit-integer-truncation.
(cherry picked from commit 7a69cf47a9)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-10 07:47:12 +02:00
Julien Palard 18ba4851ae [2.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10410) 2018-11-08 00:09:38 -08:00
Miss Islington (bot) 842efd0087
Add future_stmt to simple_stmt production list. (GH-8239)
(cherry picked from commit cdb96f45b6)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 21:16:15 -08:00
Miss Islington (bot) 322f8bc68c
glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)
(cherry picked from commit ae31e3fbf4)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:30:31 -08:00
Miss Islington (bot) d06b60fca3
Add a reference to the name mangling description in the tutorial to the index. (GH-10138)
(cherry picked from commit c5eec4426d)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:30:12 -08:00
Miss Islington (bot) 830f26d11e
Correct grammar mistakes in string.rst. (GH-9752)
(cherry picked from commit d64991031e)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 09:55:07 -08:00
Miss Islington (bot) ffbce43c1a
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347)
The test depended on '/usr/share/zoneinfo/posixrules' or equivalent
because it set TZ without explicit DST transition rules. At least
on OpenSUSE Tumbleweed that file is linked to '/etc/localtime',
making the test fail with certain local timezones,
such as 'Europe/Moscow' which doesn't have DST transitions since 2011.
(cherry picked from commit f1b9ad3d38)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-05 20:59:07 -08:00
Serhiy Storchaka 3e3e1a27f7
[2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336)
Two kind of mistakes:

1. Missed space. After concatenating there is no space between words.

2. Missed comma. Causes unintentional concatenating in a list of strings.
(cherry picked from commit 34fd4c2019)
(cherry picked from commit 7054e5c80b)
2018-11-05 18:16:26 +02:00
Stéphane Wirtel 6bf85acf60 [2.7] Docs: fix some wrong words (GH-6987) (GH-10315) 2018-11-04 14:38:50 -05:00
Miss Islington (bot) 421b41b096
Fix a typo about a comma. (GH-10306)
(cherry picked from commit fe62d877e3)

Co-authored-by: İsmail Arılık <arilik.ismail@gmail.com>
2018-11-03 10:41:56 -07:00
Benjamin Peterson a614cc9208
[2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10293)
This could cause compile errors on macOS or other platforms..
(cherry picked from commit 318ab63c01)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2018-11-01 20:28:34 -07:00
Lysandros Nikolaou aa39c1ab6d [2.7] bpo-32804: Include the context parameter in urlretrieve documentation (GH-10203) 2018-11-01 09:49:10 +08:00
Miss Islington (bot) 05acd44ad6
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.
(cherry picked from commit b08746bfdf)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-10-31 05:37:06 -07:00
matthewbelisle-wf bc6f74a520 bpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969)
Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by
limiting the number of `MiniFieldStorage` objects created by `FieldStorage`.

(cherry picked from commit 209144831b)
2018-10-30 22:16:26 +01:00
Zackery Spytz 64ffee7ad2 [2.7] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (GH-10218)
(cherry picked from commit 53835e92d3)
2018-10-29 18:03:26 +02:00
Miss Islington (bot) 4ec427b005
bpo-27741: Better wording for datetime.strptime() (GH-9994)
(cherry picked from commit c0799ec973)

Co-authored-by: Gus Goulart <augusto@goulart.me>
2018-10-29 04:55:15 -07:00
Zackery Spytz d61f586df7 [2.7] bpo-35068: Fix possible crashes in pyexpat.c. (GH-10099) 2018-10-29 09:23:59 +02:00
Serhiy Storchaka 41c7f973b6
[2.7] Fix checking for bugfix Tcl version. (GH-10185). (GH-10188)
(cherry picked from commit 18d57b4d62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-28 20:56:30 +02:00
Serhiy Storchaka aaea2802da
[2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)
Based on the investigation by Xiang Zhang.
(cherry picked from commit df13df41a2)
2018-10-28 19:36:02 +02:00
Mariatta 4704c33d9c [2.7] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10157)
Referring to ``pytest`` as ``py.test`` is deprecated..
(cherry picked from commit d855f2fdbd)

Co-authored-by: Andreas Pelme <andreas@pelme.se>
2018-10-27 11:27:33 -07:00
Miss Islington (bot) e389de8e3e
bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)
Specify that blocks are non-overlapping. Change '!=' to '<'.
(cherry picked from commit d9bff4e81b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-26 20:09:10 -07:00
Denis Ledoux 6f97a50c86 bpo-35017, socketserver: don't accept request after shutdown (GH-9952) (GH-10129)
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.

(cherry picked from commit 10cb3760e8)
2018-10-26 17:15:22 +02:00
Miss Islington (bot) 9dcb517f8e
[3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542)
(cherry picked from commit 1487b651ca)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-10-26 06:29:42 -07:00
Senthil Kumaran 971089fc2a
[2.7] bpo-34576 : Backport eeab510 2.7 (#10115)
* bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005)

* Address review comment..
(cherry picked from commit eeab510bb7)

Co-authored-by: Senthil Kumaran <skumaran@gatech.edu>
2018-10-26 01:27:09 -07:00
Zackery Spytz e131c7cf78 [2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080)
Don't leak a reference if PyDict_Update() fails, check the
PyList_New() call in treebuilder_new(), and properly handle failures
in xmlparser().

(cherry picked from commit 9f3ed3e213)
2018-10-26 08:37:07 +03:00
Zsolt Cserna 4a59c9699c [2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071)
Fix the documentation of copy2, as it does not copy file ownership (user and
group), only mode, mtime, atime and flags.

The original text was confusing to developers as it suggested that this
command is the same as 'cp -p', but according to cp(1), '-p' copies file
ownership as well.

Clarify which metadata is copied by shutil.copystat in its docstring.

(cherry picked from commit 4f399be0e7)
2018-10-24 23:22:27 +02:00
Tal Einat a1f45ec73f bpo-33899: Revert tokenize module adding an implicit final NEWLINE (GH-10072)
This reverts commit 7829bba.
2018-10-24 10:32:21 -07:00
Xiang Zhang 56a4a3aa55
[2.7] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809)
(cherry picked from commit 83a0765)

Co-authored-by: Andrei Petre p31andrei@gmail.com
2018-10-23 14:43:08 +08:00
Serhiy Storchaka 427b8c7f7d
[2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (GH-9968)
(cherry picked from commit 1deea5e539).
(cherry picked from commit bd9c2ce7ac)

Co-authored-by: Juliette Monsel <j4321@users.noreply.github.com>
2018-10-21 10:10:24 +03:00
Terry Jan Reedy f125d788ff
bpo-31500: Default fonts now are scaled on HiDPI displays. (#10015)
[2.7] bpo-31500: Add idlelib news items about HiDPI scaling
2018-10-20 19:34:12 -04:00
Cheryl Sabella 18c44cc0c1 [2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585)
(cherry picked from commit a96c96f5da)
2018-10-20 16:27:51 -04:00
Miss Islington (bot) b53edb12f7
bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004)
https://bugs.python.org/issue35032
(cherry picked from commit d262250d07)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-20 08:32:21 -07:00
Miss Islington (bot) 2bad7acdfe
bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621)
Add restriction on the offset parameter for mmap.flush.

Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix.
(cherry picked from commit 027664a3d5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-10-19 17:49:37 -07:00
Miss Islington (bot) b0f7fa1dda
bpo-21196: Clarify name mangling rules in tutorial (GH-5667)
Initial patch by Chandan Kumar.
(cherry picked from commit 13ae4d4438)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-10-19 17:45:06 -07:00
Miss Islington (bot) 2546ac8eeb bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9547)
The xml.sax and xml.dom.domreg modules now obey
sys.flags.ignore_environment.

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

https://bugs.python.org/issue34791
(cherry picked from commit 223e501fb9)

Co-authored-by: Christian Heimes <christian@python.org>
2018-10-20 01:09:35 +02:00
Miss Islington (bot) 5744a33629
Fix several reference counting bugs in pyexpat.c. (GH-9955)
(cherry picked from commit 68def052dc)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-19 00:26:37 -07:00
Stéphane Wirtel 6e57382464 [2.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9928)
Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert
Kuska.

Co-authored-by: Robert Kuska <rkuska@gmail.com>
(cherry picked from commit fcd5e84a51)





https://bugs.python.org/issue23420
2018-10-17 04:51:28 -07:00
Miss Islington (bot) f82c9f1e1a
bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827)
(cherry picked from commit e385d0661e)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-15 23:47:26 -07:00
Zackery Spytz f5e00f490a [2.7] bpo-16965: 2to3 now rewrites execfile() to open with rb. (GH-8569) (GH-9890)
(cherry picked from commit d4d60134b2)
2018-10-16 08:46:35 +03:00
Victor Stinner aadb44ee98
bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) (GH-9899)
python-gdb.py now handles errors on computing the line number
of a Python frame.

Changes:

* PyFrameObjectPtr.current_line_num() now catchs any Exception on
  calling addr2line(), instead of failing with a surprising "<class
  'TypeError'> 'FakeRepr' object is not subscriptable" error.
* All callers of current_line_num() now handle current_line_num()
  returning None.
* PyFrameObjectPtr.current_line() now also catchs IndexError on
  getting a line from the Python source file.

(cherry picked from commit 2e438cc255)
2018-10-16 00:06:23 +02:00
Serhiy Storchaka 43308dfc33
[2.7] bpo-34974: Do not replace unexpected errors in bytearray(). (GH-9852) (GH-9885)
The bytearray constructor converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
(cherry picked from commit e890421e33)
2018-10-15 08:46:16 +03:00
Serhiy Storchaka 8ba72674bd
[2.7] Add new tests for bytes and bytearray constructors. (GH-9843) (#9866)
Covered all special cases: bytes, tuple, list, differend
kinds of iterables and iterators.
(cherry picked from commit 1a997eb291)
2018-10-14 13:07:54 +03:00
Zackery Spytz 68ddb59417 [2.7] bpo-22851: Fix a segfault when accessing generator.gi_frame.f_restricted. (GH-9348)
Frame's field f_tstate is NULL when the generator is exhausted.
2018-10-13 12:25:05 +03:00
Miss Islington (bot) 6198976ec8
bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796)
(cherry picked from commit 4505f65ae7)

Co-authored-by: Gus Goulart <augusto@goulart.me>
2018-10-12 05:06:16 -07:00
Victor Stinner b274f1ce5c
bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) (GH-9788)
When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.

test_gdb: get_gdb_repr() now uses the "backtrace 1" command after
breakpoint, as in the master branch.

Co-Authored-By: Marcel Plch <gmarcel.plch@gmail.com>

(cherry picked from commit 9b7c74ca32)
(cherry picked from commit 79d21331e6)
2018-10-10 12:54:04 +02:00
tzickel 4a7dd30f58 [2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686)
Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
2018-10-03 13:50:04 +02:00
Andrés Delfino 8d3b0f4902 [2.7] bpo-13407: Mention that bz2/tarfile doesn't support multi-stream bzip2 files (GH-8428)
* bpo-13407: Mention that tarfile doesn't support multistream bzip2 files

* Add mention to bz2 module also
2018-09-29 10:57:35 -06:00
Victor Stinner 911231e708
Drop confusing commented out code in pystrtod.c (GH-6072) (GH-9588)
Fix the following warning:

Python/pystrtod.c: In function 'format_float_short':
Python/pystrtod.c:1007:13: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
             strncpy(p, "ERR", 3);

(cherry picked from commit 9fb8415759)
2018-09-26 08:18:23 -07:00