Commit Graph

103294 Commits

Author SHA1 Message Date
Miss Islington (bot) 735a960ac9
bpo-36311: Fixes decoding multibyte characters around chunk boundaries and improves decoding performance (GH-15083)
(cherry picked from commit 7ebdda0dbe)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-08-21 16:55:57 -07:00
Miss Islington (bot) c5bba853d5
bpo-37482: Fix email address name with encoded words and special chars (GH-14561)
Special characters in email address header display names are normally
put within double quotes. However, encoded words (=?charset?x?...?=) are
not allowed withing double quotes. When the header contains a word with
special characters and another word that must be encoded, the first one
must also be encoded.

In the next example, the display name in the From header is quoted and
therefore the comma is allowed; in the To header, the comma is not
within quotes and not encoded, which is not allowed and therefore
rejected by some mail servers.

From: "Foo Bar, France" <foo@example.com>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <foo@example.com>

https://bugs.python.org/issue37482
(cherry picked from commit df0c21ff46)

Co-authored-by: bsiem <52461103+bsiem@users.noreply.github.com>
2019-08-21 16:21:48 -07:00
Miss Islington (bot) fb3d7423f7 Update asyncio.ensure_future() documentation (GH-15347) (GH-15361)
Added back mention that ensure_future actually scheduled obj. This documentation just mentions what ensure_future returns, so I did not realize that ensure_future also schedules obj.
(cherry picked from commit 092911d5c0)

Co-authored-by: Roger Iyengar <ri@rogeriyengar.com>
2019-08-21 13:01:53 -04:00
Miss Islington (bot) 72088d5624
bpo-37823: Fix open() link in telnetlib doc (GH-15281)
Fixed wrong link to Telnet.open() method in telnetlib documentation.
(cherry picked from commit e0b6117e27)

Co-authored-by: Michael Anckaert <michael.anckaert@sinax.be>
2019-08-21 04:38:25 -07:00
Miss Islington (bot) b9d88e7712
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)
If this service had thoroughly vanished, we could just ignore the
test until someone gets around to either recreating such a service
or redesigning the test to somehow work locally.  The
`support.transient_internet` mechanism catches the failure to
resolve the domain name, and skips the test.

But in fact the domain snakebite.net does still exist, as do its
nameservers -- and they can be quite slow to reply.  As a result
this test can easily take 20-30s before it gets auto-skipped.

So, skip the test explicitly up front.
(cherry picked from commit 5b95a1507e)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-08-20 21:11:25 -07:00
Victor Stinner c9a484a1e7
bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333) (GH-15342) (GH-15343)
pymalloc_alloc() now returns directly the pointer, return NULL on
memory allocation error.

allocate_from_new_pool() already uses NULL as marker for "allocation
failed".

(cherry picked from commit 18f8dcfa10)
(cherry picked from commit 30e5aff5fb)
2019-08-20 15:29:08 +01:00
Miss Islington (bot) 02c1457a03
bpo-37868: Improve is_dataclass for instances. (GH-15325)
(cherry picked from commit b0f4dab873)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2019-08-19 23:01:55 -07:00
Miss Islington (bot) 0fcdd8d6d6
bpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296)
The documented definition was much broader than the real one:
there are tons of characters with general category "Other",
and we don't (and shouldn't) treat most of them as whitespace.

Rewrite the definition to agree with the comment on
_PyUnicode_IsWhitespace, and with the logic in makeunicodedata.py,
which is what generates that function and so ultimately governs.

Add suitable breadcrumbs so that a reader who wants to pin down
exactly what this definition means (what's a "bidirectional class"
of "B"?) can do so.  The `unicodedata` module documentation is an
appropriate central place for our references to Unicode's own copious
documentation, so point there.

Also add to the isspace() test a thorough check that the
implementation agrees with the intended definition.
(cherry picked from commit 8c1c426a63)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-08-19 03:10:14 -07:00
Miss Islington (bot) 316acf2704
fix link to time function from time_ns doc (GH-15285)
Because mod, func, class, etc all share one namespace, :func:time creates a link to the time module doc page rather than the time.time function.
(cherry picked from commit 1b1d0514ad)

Co-authored-by: Éric Araujo <merwok@netwok.org>
2019-08-17 13:51:11 -07:00
Paul Ganssle ed44b84961
bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15226)
This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878

(cherry picked from commit 92c7e30adf)
2019-08-15 15:09:37 -04:00
Miss Islington (bot) 6ac851fadf
Indent code inside if block. (GH-15284)
Without indendation, seems like strcpy line is parallel to `if` condition.
(cherry picked from commit 69f37bcb28)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
2019-08-15 09:46:47 -07:00
Miss Islington (bot) 2b9b70765c
Replace usage of the obscure PEM_read_bio_X509_AUX with the more standard PEM_read_bio_X509 (GH-15303)
X509_AUX is an odd, note widely used, OpenSSL extension to the X509 file format. This function doesn't actually use any of the extra metadata that it parses, so just use the standard API.

Automerge-Triggered-By: @tiran
(cherry picked from commit 40dad9545a)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2019-08-15 05:55:59 -07:00
Miss Islington (bot) 1581d9c405
bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)
faulthandler now allocates a dedicated stack of SIGSTKSZ*2 bytes,
instead of just SIGSTKSZ bytes. Calling the previous signal handler
in faulthandler signal handler uses more than SIGSTKSZ bytes of stack
memory on some platforms.
(cherry picked from commit ac827edc49)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-08-14 15:09:39 -07:00
Miss Islington (bot) b0b178a2b8
bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
FreeBSD implementation of poll(2) restricts the timeout argument to be
either zero, or positive, or equal to INFTIM (-1).

Unless otherwise overridden, socket timeout defaults to -1. This value
is then converted to milliseconds (-1000) and used as argument to the
poll syscall. poll returns EINVAL (22), and the connection fails.

This bug was discovered during the EINTR handling testing, and the
reproduction code can be found in
https://bugs.python.org/issue23618 (see connect_eintr.py,
attached). On GNU/Linux, the example runs as expected.

This change is trivial:
If the supplied timeout value is negative, truncate it to -1.
(cherry picked from commit 2814620657)

Co-authored-by: Artem Khramov <akhramov@pm.me>
2019-08-14 14:48:03 -07:00
Miss Islington (bot) 88cce7b59f
bpo-37849: IDLE: fix completion window positioning above line (GH-15267)
(cherry picked from commit 71662dc2f1)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-08-14 10:37:49 -07:00
Victor Stinner 93bee6a8d8
[3.7] bpo-37531: Fix regrtest timeout for subprocesses (GH-15072) (GH-15280)
Co-Authored-By: Joannah Nanjekye <joannah.nanjekye@ibm.com>
(cherry picked from commit b0c8369c60)

Backport also minor win_utils.py fixes from master.
2019-08-14 16:30:54 +02:00
Miss Islington (bot) 3e1f135b26
bpo-37256: Wording in Request class docs (GH-14792)
* bpo-37256: Wording in Request class docs

* 📜🤖 Added by blurb_it.

* Update Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 38c7199beb)

Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>
2019-08-14 06:55:53 -07:00
Victor Stinner 7eef81ee76
bpo-37738: Fix curses addch(str, color_pair) (GH-15071) (GH-15273)
Fix the implementation of curses addch(str, color_pair): pass the
color pair to setcchar(), instead of always passing 0 as the color
pair.

(cherry picked from commit 077af8c2c9)
2019-08-14 13:00:27 +02:00
Miss Islington (bot) 15b6d0a712
bpo-37681: no_sanitize_thread support from GCC 5.1 (GH-15096)
Fix the following warning with GCC 4.8.5:
Objects/obmalloc.c: warning: ‘no_sanitize_thread’ attribute directive ignored
(cherry picked from commit 7e479c8221)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2019-08-14 03:16:54 -07:00
Hai Shi fbb0c032e8 bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-15259)
Add error number 113 EHOSTUNREACH to get_socket_conn_refused_errs()
of test.support.
2019-08-14 11:52:36 +02:00
Josh Holland 37fd9f73e2 [3.7] bpo-37814: Document the empty tuple type annotation syntax (GH-15208) (GH-15262)
https://bugs.python.org/issue37814:

> The empty tuple syntax in type annotations, `Tuple[()]`, is not obvious from the examples given in the documentation (I naively expected `Tuple[]` to work); it has been documented in PEP 484 and in mypy, but not in the documentation for the typing module.

https://bugs.python.org/issue37814
(cherry picked from commit 8a784af750)

Co-authored-by: Josh Holland <anowlcalledjosh@gmail.com>





https://bugs.python.org/issue37814



Automerge-Triggered-By: @gvanrossum
2019-08-13 12:26:12 -07:00
Miss Islington (bot) 9286677538 Fix docs for assert_called and assert_called_once (GH-15218)
(cherry picked from commit f9590edfea)

Co-authored-by: Ismail S <ismail-s@users.noreply.github.com>
2019-08-12 09:18:55 +01:00
Miss Islington (bot) dec231a73c
bpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. (GH-15044)
This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string.

https://bugs.python.org/issue32178
(cherry picked from commit 09a1872a80)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-08-11 14:05:37 -07:00
Miss Islington (bot) c48d606adc
bpo-34155: Dont parse domains containing @ (GH-13079)
Before:

        >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
        (Address(display_name='', username='a', domain='malicious.org'),)

        >>> parseaddr('a@malicious.org@important.com')
        ('', 'a@malicious.org')

    After:

        >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
        (Address(display_name='', username='', domain=''),)

        >>> parseaddr('a@malicious.org@important.com')
        ('', 'a@')

https://bugs.python.org/issue34155
(cherry picked from commit 8cb65d1381)

Co-authored-by: jpic <jpic@users.noreply.github.com>
2019-08-09 01:30:33 -07:00
Miss Islington (bot) 7dafbe81bd bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for ratio method (GH-13482) (#15158)
https://bugs.python.org/issue37004
(cherry picked from commit e9cbcd0018)

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
2019-08-07 11:39:47 -04:00
Miss Islington (bot) 18343aba78
Improve signal documentation (GH-14274)
* add a missing ``.. availability::`` reST explicit markup;
* more consistent "see man page" sentences.
(cherry picked from commit cfebfef2de)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2019-08-06 14:55:48 -07:00
Miss Islington (bot) 4969192f99
bpo-36419: IDLE - Refactor autocompete and improve testing. (GH-15121)
(cherry picked from commit 1213123005)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-04 17:09:36 -07:00
Miss Islington (bot) a96f0367d4
bpo-37748: Re-order the Run menu. (GH-15115)
Put the most common choice, Run Module, at the top.
(cherry picked from commit 14070299cd)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-04 14:07:26 -07:00
Tal Einat a2ea9448c6
[3.7] bpo-34621: backwards-compatible pickle UUID with is_safe=unknown (GH-14834)
This is a fix for a bug introduced in the original implementation of this for 3.7.
2019-08-04 22:26:32 +03:00
Miss Islington (bot) 9e0c48a002
bpo-37706: IDLE - fix sidebar code bug and drag tests (GH-15103)
Convert mouse y to line number in the sidebar rather than the text.
(cherry picked from commit 86f1a18abf)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-08-04 09:47:11 -07:00
Serhiy Storchaka 8cd6305784
[3.7] bpo-37730: Fix usage of NotImplemented instead of NotImplementedError in docs. (GH-15062). (GH-15106)
(cherry picked from commit ed5e8e06cb)

Co-authored-by: David H <dheiberg@mozilla.com>
2019-08-04 17:06:51 +03:00
Serhiy Storchaka 6ed20e54e4
[3.7] bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996) (GH-15104)
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
(cherry picked from commit 17e52649c0)
2019-08-04 15:28:21 +03:00
Miss Islington (bot) 0bb8f22abd Correct description of HTTP status code 308. (GH-15097)
Permanent redirect was explained as a temporary redirect.
(cherry picked from commit 5c72badd06)

Co-authored-by: Florian Wendelborn <1133858+FlorianWendelborn@users.noreply.github.com>
2019-08-03 11:40:09 -07:00
Miss Islington (bot) a49f203e05
bpo-30974: Change os.path.samefile docstring to match docs (GH-7337)
(cherry picked from commit 8e568ef266)

Co-authored-by: Timo Furrer <tuxtimo@gmail.com>
2019-08-02 16:11:33 -07:00
Miss Islington (bot) 1ff7dd681c
bpo-20523: pdb searches for .pdbrc in ~ instead of $HOME (GH-11847)
Previously pdb checked the $HOME environmental variable
to find the user .pdbrc. If $HOME is not set, the user
.pdbrc would not be found.

Change pdb to use `os.path.expanduser('~')` to determine
the user's home directory. Thus, if $HOME is not set (as
in tox or on Windows), os.path.expanduser('~') falls
back on other techniques for locating the user's home
directory.

This follows pip's implementation for loading .piprc.

Co-authored-by: Dan Lidral-Porter <dlp@aperiodic.org>
(cherry picked from commit 7ea9a85f13)

Co-authored-by: Timothy Hopper <tdhopper@users.noreply.github.com>
2019-08-02 15:40:14 -07:00
Miss Islington (bot) 8990ac0ab0 bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15069)
(cherry picked from commit 2491134029)

Co-authored-by: mental <m3nta1@yahoo.com>
2019-08-01 07:35:20 -07:00
Miss Islington (bot) 35d9c37e27
bpo-37695: Correct unget_wch error message. (GH-14986)
(cherry picked from commit c9345e382c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-07-31 13:25:45 -07:00
Miss Islington (bot) 33b700ba8c
bpo-37723: Fix performance regression on regular expression parsing. (GH-15030)
Improve performance of sre_parse._uniq function.
(cherry picked from commit 9f55551f3d)

Co-authored-by: yannvgn <hi@yannvgn.io>
2019-07-31 13:22:19 -07:00
Miss Islington (bot) 3533061371 bpo-34101: Add doc of PyBuffer_GetPointer (GH-14994) (GH-15055)
(cherry picked from commit 1b29af83bc)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2019-07-31 16:57:09 +02:00
Miss Islington (bot) 8c6e35d2d2
bpo-33821: Update IDLE section of What's New 3.7 (GH-15036)
* bpo-33821: Update IDLE section of What's New 3.7

* Fix roles.
(cherry picked from commit 5982b7201b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-30 22:24:43 -07:00
Miss Islington (bot) ac7cb7b9be
bpo-34162: Add missing items to idlelib/NEWS.txt. (GH-15034)
(cherry picked from commit fff5cb21ae)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-30 22:21:14 -07:00
Miss Islington (bot) 362217c7d6
Fix idlelib typos discovered by min ho, pr 15018. (GH-15029)
(cherry picked from commit 0acb646b8e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-30 15:33:30 -07:00
Terry Jan Reedy e941cbcf8c
bpo-34162: Update idlelib/news.txt for 3.7.5 (GH-15016) 2019-07-29 19:21:11 -04:00
Miss Islington (bot) 6c9f46fa3a
bpo-34162: Update idlelib/news.txt. (GH-15011)
(cherry picked from commit f35c51d2ea)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-29 15:36:20 -07:00
Miss Islington (bot) ad36d21223
bpo-37706: Disable 3 IDLE scrollbar tests on Mac. (GH-15010)
They pass with tk 8.5.9 (Azure) but fail with the 8.6.x we install.
(cherry picked from commit e8874b85b4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-29 15:22:59 -07:00
Miss Islington (bot) d30626443d
bpo-37692: Improve highlight config sample (GH-14983)
Use an example shell interaction in the sample and better labels for shell elements.
(cherry picked from commit b222955355)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-28 09:22:18 -07:00
Miss Islington (bot) 0242eb3fa7
bpo-37628: Fix IDLE config sample sizes (GH-14958)
The boxes for the font and highlight samples are now constrained by the overall config dialog size.  They gain scrollbars when the when a large font size makes the samples too large for the box.
(cherry picked from commit 3221a63c69)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-07-27 10:14:54 -07:00
Miss Islington (bot) 9e7697b3c5
bpo-17535: Increase line number horizontal padding by 2 pixels (GH-14959)
(cherry picked from commit 46ebd4a6a2)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-26 20:42:00 -07:00
Miss Islington (bot) 4b6421c61e
bpo-32910: Remove implementation detail in venv documentation. (GH-14968)
(cherry picked from commit 91e4957509)

Co-authored-by: Derek Keeler <d3r3kk@users.noreply.github.com>
2019-07-26 15:03:23 -07:00
Miss Islington (bot) ea0f7aa47c
bpo-37664: Update bundled pip to 19.2.1 and setuptools to 41.0.1 (GH-14934)
(cherry picked from commit 5380def826)

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2019-07-26 10:19:15 -07:00