]> granicus.if.org Git - python/log
python
5 years agobpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)
Pablo Galindo [Thu, 22 Aug 2019 19:24:25 +0000 (20:24 +0100)]
bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)

https://bugs.python.org/issue37915

Automerge-Triggered-By: @pablogsal
5 years agobpo-28556: Add a regression test to typing (GH-15396)
Ivan Levkivskyi [Thu, 22 Aug 2019 17:48:01 +0000 (18:48 +0100)]
bpo-28556: Add a regression test to typing (GH-15396)

This adds a regression test for the issue found in the Python 2 backport, see https://github.com/python/typing/issues/656

https://bugs.python.org/issue28556

5 years agobpo-32554: Deprecate hashing arbitrary types in random.seed() (GH-15382)
Raymond Hettinger [Thu, 22 Aug 2019 16:19:36 +0000 (09:19 -0700)]
bpo-32554: Deprecate hashing arbitrary types in random.seed() (GH-15382)

5 years agobpo-14050: Note that not all data can be sorted (GH-15381)
Raymond Hettinger [Thu, 22 Aug 2019 16:11:35 +0000 (09:11 -0700)]
bpo-14050: Note that not all data can be sorted (GH-15381)

5 years agobpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388)
Sergey Fedoseev [Thu, 22 Aug 2019 15:28:28 +0000 (20:28 +0500)]
bpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388)

5 years agoAdd missing space to warning message (GH-14915)
Florian Bruhin [Thu, 22 Aug 2019 06:06:51 +0000 (08:06 +0200)]
Add missing space to warning message (GH-14915)

This typo was introduced in GH-13409 when changing the message text.

5 years agoRefactor Parser/pgen and add documentation and explanations (GH-15373)
Pablo Galindo [Thu, 22 Aug 2019 01:38:39 +0000 (02:38 +0100)]
Refactor Parser/pgen and add documentation and explanations (GH-15373)

* Refactor Parser/pgen and add documentation and explanations

To improve the readability and maintainability of the parser
generator perform the following transformations:

    * Separate the metagrammar parser in its own class to simplify
      the parser generator logic.

    * Create separate classes for DFAs and NFAs and move methods that
      act exclusively on them from the parser generator to these
      classes.

    * Add docstrings and comment documenting the process to go from
      the grammar file into NFAs and then DFAs. Detail some of the
      algorithms and give some background explanations of some concepts
      that will helps readers not familiar with the parser generation
      process.

    * Select more descriptive names for some variables and variables.

    * PEP8 formatting and quote-style homogenization.

The output of the parser generator remains the same (Include/graminit.h
and Python/graminit.c remain untouched by running the new parser generator).

5 years agobpo-37834: Fix test on Windows 7 (GH-15377)
Steve Dower [Thu, 22 Aug 2019 00:42:56 +0000 (17:42 -0700)]
bpo-37834: Fix test on Windows 7 (GH-15377)

5 years agobpo-9949: Call normpath() in realpath() and avoid unnecessary prefixes (GH-15369)
Steve Dower [Wed, 21 Aug 2019 23:45:02 +0000 (16:45 -0700)]
bpo-9949: Call normpath() in realpath() and avoid unnecessary prefixes (GH-15369)

5 years agobpo-36311: Fixes decoding multibyte characters around chunk boundaries and improves...
Steve Dower [Wed, 21 Aug 2019 23:22:33 +0000 (16:22 -0700)]
bpo-36311: Fixes decoding multibyte characters around chunk boundaries and improves decoding performance (GH-15083)

5 years agobpo-37482: Fix email address name with encoded words and special chars (GH-14561)
bsiem [Wed, 21 Aug 2019 23:00:39 +0000 (01:00 +0200)]
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

5 years agobpo-37663: have venv activation scripts all consistently use __VENV_PROMPT__ for...
Brett Cannon [Wed, 21 Aug 2019 22:58:01 +0000 (15:58 -0700)]
bpo-37663: have venv activation scripts all consistently use __VENV_PROMPT__ for prompt customization (GH-14941)

The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used `__VENV_PROMPT__` exclusively, some used `__VENV_PROMPT__` if it was set even though by default `__VENV_PROMPT__` is always set and the fallback matched the default, and one ignored `__VENV_PROMPT__` and used `__VENV_NAME__` instead (and even used a differing format to the default prompt). This change now has all activation scripts use `__VENV_PROMPT__` only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).

5 years agobpo-37834: Normalise handling of reparse points on Windows (GH-15231)
Steve Dower [Wed, 21 Aug 2019 22:27:33 +0000 (15:27 -0700)]
bpo-37834: Normalise handling of reparse points on Windows (GH-15231)

bpo-37834: Normalise handling of reparse points on Windows
* ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed)
* nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point)
* nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour)
* nt.readlink() will read destinations for symlinks and junction points only

bpo-1311: os.path.exists('nul') now returns True on Windows
* nt.stat('nul').st_mode is now S_IFCHR (previously was an error)

5 years agoRevert mode change that loses information in directory listings on Linux. (#15366)
Stefan Krah [Wed, 21 Aug 2019 21:00:04 +0000 (23:00 +0200)]
Revert mode change that loses information in directory listings on Linux. (#15366)

5 years agobpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)
Steve Dower [Wed, 21 Aug 2019 20:43:06 +0000 (13:43 -0700)]
bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)

5 years agoFix difflib `?` hint in diff output when dealing with tabs (#15201)
Anthony Sottile [Wed, 21 Aug 2019 18:59:26 +0000 (11:59 -0700)]
Fix difflib `?` hint in diff output when dealing with tabs (#15201)

5 years agoUpdate asyncio.ensure_future() documentation (GH-15347)
Roger Iyengar [Wed, 21 Aug 2019 15:59:11 +0000 (11:59 -0400)]
Update asyncio.ensure_future() documentation (GH-15347)

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.

5 years agobpo-37751: Fix codecs.lookup() normalization (GH-15092)
Jordon Xu [Wed, 21 Aug 2019 13:26:20 +0000 (21:26 +0800)]
bpo-37751: Fix codecs.lookup() normalization (GH-15092)

Fix codecs.lookup() to normalize the encoding name the same way
than encodings.normalize_encoding(), except that codecs.lookup()
also converts the name to lower case.

5 years agobpo-37860: Add netlify deploy preview for docs (GH-15288)
Ashwin Ramaswami [Wed, 21 Aug 2019 13:08:47 +0000 (06:08 -0700)]
bpo-37860: Add netlify deploy preview for docs (GH-15288)

* add netlify deploy preview

* fix publish path

* install python3 venv

* add sudo

* try without venv

* install right dependencies

* use python3, not python

* use pip3

* python3.7

* use requirements.txt

* move requirements.txt to Doc

* use python 3.7 in runtime.txt

* move runtime.txt

* Update requirements.txt

5 years agobpo-37851: faulthandler allocates its stack on demand (GH-15358)
Victor Stinner [Wed, 21 Aug 2019 12:40:42 +0000 (13:40 +0100)]
bpo-37851: faulthandler allocates its stack on demand (GH-15358)

The faulthandler module no longer allocates its alternative stack at
Python startup. Now the stack is only allocated at the first
faulthandler usage.

faulthandler no longer ignores memory allocation failure when
allocating the stack. sigaltstack() failure now raises an OSError
exception, rather than being ignored.

The alternative stack is no longer used if sigaction() is
not available. In practice, sigaltstack() should only be available
when sigaction() is avaialble, so this change should have no effect
in practice.

faulthandler.dump_traceback_later() internal locks are now only
allocated at the first dump_traceback_later() call, rather than
always being allocated at Python startup.

5 years agobpo-37823: Fix open() link in telnetlib doc (GH-15281)
Michael Anckaert [Wed, 21 Aug 2019 11:13:34 +0000 (13:13 +0200)]
bpo-37823: Fix open() link in telnetlib doc (GH-15281)

Fixed wrong link to Telnet.open() method in telnetlib documentation.

5 years agobpo-37531: Enhance regrtest multiprocess timeout (GH-15345)
Victor Stinner [Wed, 21 Aug 2019 09:59:20 +0000 (10:59 +0100)]
bpo-37531: Enhance regrtest multiprocess timeout (GH-15345)

* Write a message when killing a worker process
* Put a timeout on the second popen.communicate() call
  (after killing the process)
* Put a timeout on popen.wait() call
* Catch popen.kill() and popen.wait() exceptions

5 years agoUnmark files as executable that can't actually be executed. (GH-15353)
Greg Price [Wed, 21 Aug 2019 04:53:59 +0000 (21:53 -0700)]
Unmark files as executable that can't actually be executed. (GH-15353)

There are plenty of legitimate scripts in the tree that begin with a
`#!`, but also a few that seem to be marked executable by mistake.

Found them with this command -- it gets executable files known to Git,
filters to the ones that don't start with a `#!`, and then unmarks
them as executable:

    $ git ls-files --stage \
      | perl -lane 'print $F[3] if (!/^100644/)' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          || chmod a-x "$f"; \
        done

Looking at the list by hand confirms that we didn't sweep up any
files that should have the executable bit after all.  In particular

 * The `.psd` files are images from Photoshop.

 * The `.bat` files sure look like things that can be run.
   But we have lots of other `.bat` files, and they don't have
   this bit set, so it must not be needed for them.

Automerge-Triggered-By: @benjaminp
5 years agobpo-35518: Skip test that relies on a deceased network service. (GH-15349)
Greg Price [Wed, 21 Aug 2019 03:50:51 +0000 (20:50 -0700)]
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.

5 years agoabstract.c should not be executable. (GH-15348)
Benjamin Peterson [Wed, 21 Aug 2019 02:19:43 +0000 (19:19 -0700)]
abstract.c should not be executable. (GH-15348)

5 years agoRemove a dead comment from ossaudiodev.c (#15346)
Brett Cannon [Tue, 20 Aug 2019 19:20:47 +0000 (12:20 -0700)]
Remove a dead comment from ossaudiodev.c (#15346)

5 years agobpo-32793: Fix a duplicate debug message in smtplib (GH-15341)
Zackery Spytz [Tue, 20 Aug 2019 17:52:25 +0000 (11:52 -0600)]
bpo-32793: Fix a duplicate debug message in smtplib (GH-15341)

_get_socket() already prints a debug message for the host and port.

https://bugs.python.org/issue32793

Automerge-Triggered-By: @maxking
5 years agobpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)
Joannah Nanjekye [Tue, 20 Aug 2019 14:46:36 +0000 (11:46 -0300)]
bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)

Implement PyBuffer_SizeFromFormat() function (previously
documented but not implemented): call struct.calcsize().

5 years agobpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333)
Victor Stinner [Tue, 20 Aug 2019 11:28:02 +0000 (12:28 +0100)]
bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333)

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".

5 years agobpo-37868: Improve is_dataclass for instances. (GH-15325)
Eric V. Smith [Tue, 20 Aug 2019 05:40:28 +0000 (01:40 -0400)]
bpo-37868: Improve is_dataclass for instances. (GH-15325)

5 years agoMinor documentation fixes on library/enum (GH-15234)
Antoine [Tue, 20 Aug 2019 01:41:31 +0000 (03:41 +0200)]
Minor documentation fixes on library/enum (GH-15234)

* Minor documentation fixes on library/enum

5 years agoDelete stale comment in Python/getopt.c. (GH-14719)
Hansraj Das [Tue, 20 Aug 2019 01:35:13 +0000 (07:05 +0530)]
Delete stale comment in Python/getopt.c. (GH-14719)

5 years agoRevert "bpo-37788: Fix a reference leak if a thread is not joined (GH-15228)" (GH...
Victor Stinner [Mon, 19 Aug 2019 23:47:07 +0000 (00:47 +0100)]
Revert "bpo-37788: Fix a reference leak if a thread is not joined (GH-15228)" (GH-15338)

This reverts commit d3dcc92778807ae8f7ebe85178f36a29711cd478.

5 years agobpo-37788: Fix a reference leak if a thread is not joined (GH-15228)
Victor Stinner [Mon, 19 Aug 2019 22:37:17 +0000 (23:37 +0100)]
bpo-37788: Fix a reference leak if a thread is not joined (GH-15228)

Add threading.Thread.__del__() method to ensure that the thread state
lock is removed from the _shutdown_locks list when a thread
completes.

5 years agoRemove 'unstable' warning for Windows Store package in docs (GH-15334)
Steve Dower [Mon, 19 Aug 2019 17:07:25 +0000 (10:07 -0700)]
Remove 'unstable' warning for Windows Store package in docs (GH-15334)

5 years agobpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
shireenrao [Sat, 17 Aug 2019 20:50:39 +0000 (16:50 -0400)]
bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)

5 years agoInsert a missing close parenthesis (GH-15316)
cocoatomo [Sat, 17 Aug 2019 20:40:23 +0000 (05:40 +0900)]
Insert a missing close parenthesis (GH-15316)

5 years agofix link to time function from time_ns doc (GH-15285)
Éric Araujo [Sat, 17 Aug 2019 20:34:08 +0000 (16:34 -0400)]
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.

5 years agoAdd a minor `Fraction.__hash__()` optimization (GH-15313)
Tim Peters [Sat, 17 Aug 2019 02:09:16 +0000 (21:09 -0500)]
Add a minor `Fraction.__hash__()` optimization (GH-15313)

* Add a minor `Fraction.__hash__` optimization that got lost in the shuffle.

Document the optimizations.

5 years agobpo-37540: vectorcall: keyword names must be strings (GH-14682)
Jeroen Demeyer [Fri, 16 Aug 2019 10:41:27 +0000 (12:41 +0200)]
bpo-37540: vectorcall: keyword names must be strings (GH-14682)

The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not.

CC @markshannon @vstinner

https://bugs.python.org/issue37540

5 years agobpo-37863: Optimize Fraction.__hash__() (#15298)
Raymond Hettinger [Fri, 16 Aug 2019 03:58:26 +0000 (20:58 -0700)]
bpo-37863: Optimize Fraction.__hash__() (#15298)

5 years agoIndent code inside if block. (GH-15284)
Hansraj Das [Thu, 15 Aug 2019 16:19:07 +0000 (21:49 +0530)]
Indent code inside if block. (GH-15284)

Without indendation, seems like strcpy line is parallel to `if` condition.

5 years agobpo-37207: enable vectorcall for type.__call__ (GH-14588)
Jeroen Demeyer [Thu, 15 Aug 2019 15:49:46 +0000 (17:49 +0200)]
bpo-37207: enable vectorcall for type.__call__ (GH-14588)

Base PR for other PRs that want to play with `type.__call__` such as #13930 and #14589.

The author is really @markshannon I just made the PR.

https://bugs.python.org/issue37207

Automerge-Triggered-By: @encukou
5 years agoReplace usage of the obscure PEM_read_bio_X509_AUX with the more standard PEM_read_bi...
Alex Gaynor [Thu, 15 Aug 2019 12:31:28 +0000 (08:31 -0400)]
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
5 years agobpo-37760: Avoid cluttering work tree with downloaded Unicode files. (GH-15128)
Greg Price [Thu, 15 Aug 2019 01:18:53 +0000 (18:18 -0700)]
bpo-37760: Avoid cluttering work tree with downloaded Unicode files. (GH-15128)

5 years agobpo-37775: Update compileall doc for invalidation_mode parameter (GH-15148)
Hai Shi [Wed, 14 Aug 2019 22:03:11 +0000 (17:03 -0500)]
bpo-37775: Update compileall doc for invalidation_mode parameter (GH-15148)

5 years agobpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)
Victor Stinner [Wed, 14 Aug 2019 21:35:27 +0000 (23:35 +0200)]
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.

5 years agobpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
Artem Khramov [Wed, 14 Aug 2019 21:21:48 +0000 (03:21 +0600)]
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.

5 years agobpo-37826: Document exception chaining in Python tutorial for errors. (GH-15243)
Abhilash Raj [Wed, 14 Aug 2019 21:11:32 +0000 (14:11 -0700)]
bpo-37826: Document exception chaining in Python tutorial for errors. (GH-15243)

https://bugs.python.org/issue37826

5 years agobpo-37849: IDLE: fix completion window positioning above line (GH-15267)
Tal Einat [Wed, 14 Aug 2019 17:06:06 +0000 (20:06 +0300)]
bpo-37849: IDLE: fix completion window positioning above line (GH-15267)

5 years agobpo-36030: Improve performance of some tuple operations (GH-12052)
Sergey Fedoseev [Wed, 14 Aug 2019 14:10:33 +0000 (19:10 +0500)]
bpo-36030: Improve performance of some tuple operations (GH-12052)

5 years agobpo-37531: Fix regrtest timeout for subprocesses (GH-15072)
Victor Stinner [Wed, 14 Aug 2019 12:18:51 +0000 (14:18 +0200)]
bpo-37531: Fix regrtest timeout for subprocesses (GH-15072)

Co-Authored-By: Joannah Nanjekye <joannah.nanjekye@ibm.com>
5 years agobpo-36502: Correct documentation of str.isspace() (GH-15019)
Greg Price [Wed, 14 Aug 2019 11:05:19 +0000 (04:05 -0700)]
bpo-36502: Correct documentation of str.isspace() (GH-15019)

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.

5 years agobpo-37738: Fix curses addch(str, color_pair) (GH-15071)
Victor Stinner [Wed, 14 Aug 2019 10:31:43 +0000 (12:31 +0200)]
bpo-37738: Fix curses addch(str, color_pair) (GH-15071)

Fix the implementation of curses addch(str, color_pair): pass the
color pair to setcchar(), instead of always passing 0 as the color
pair.

5 years agobpo-37681: no_sanitize_thread support from GCC 5.1 (GH-15096)
Hai Shi [Wed, 14 Aug 2019 09:50:19 +0000 (04:50 -0500)]
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

5 years agobpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814)
Zackery Spytz [Wed, 14 Aug 2019 05:51:06 +0000 (23:51 -0600)]
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814)

Commit b1263d5a60d3f7ab02dd28409fff59b3815a3f67 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.

5 years agobpo-37760: Factor out standard range-expanding logic in makeunicodedata. (GH-15248)
Greg Price [Wed, 14 Aug 2019 02:28:38 +0000 (19:28 -0700)]
bpo-37760: Factor out standard range-expanding logic in makeunicodedata. (GH-15248)

Much like the lower-level logic in commit ef2af1ad4, we had
4 copies of this logic, written in a couple of different ways.
They're all implementing the same standard, so write it just once.

5 years agobpo-37256: Wording in Request class docs (#14792)
Ngalim Siregar [Wed, 14 Aug 2019 01:10:58 +0000 (08:10 +0700)]
bpo-37256: Wording in Request class docs (#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>
5 years agobpo-25172: Add test for crypt ImportError on Windows (GH-15252)
shireenrao [Tue, 13 Aug 2019 21:27:34 +0000 (17:27 -0400)]
bpo-25172: Add test for crypt ImportError on Windows (GH-15252)

5 years agobpo-37689: add Path.is_relative_to() method (GH-14982)
Hai Shi [Tue, 13 Aug 2019 19:54:02 +0000 (14:54 -0500)]
bpo-37689: add Path.is_relative_to() method (GH-14982)

5 years agobpo-37814: Document the empty tuple type annotation syntax (GH-15208)
Josh Holland [Tue, 13 Aug 2019 19:05:09 +0000 (20:05 +0100)]
bpo-37814: Document the empty tuple type annotation syntax (GH-15208)

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

5 years agobpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)
Hai Shi [Tue, 13 Aug 2019 17:37:59 +0000 (12:37 -0500)]
bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)

Add error number 113 EHOSTUNREACH to get_socket_conn_refused_errs()
of test.support.

5 years agobpo-37841: Remove python_uwp dependency on msvcp140.dll (GH-15253)
Steve Dower [Tue, 13 Aug 2019 17:34:07 +0000 (10:34 -0700)]
bpo-37841: Remove python_uwp dependency on msvcp140.dll (GH-15253)

5 years agobpo-37760: Constant-fold some old options in makeunicodedata. (GH-15129)
Greg Price [Tue, 13 Aug 2019 05:59:30 +0000 (22:59 -0700)]
bpo-37760: Constant-fold some old options in makeunicodedata. (GH-15129)

The `expand` option was introduced in 2000 in commit fad27aee1.
It appears to have been always set since it was committed, and
what it does is tell the code to do something essential.  So,
just always do that, and cut the option.

Also cut the `linebreakprops` option, which isn't consulted anymore.

5 years agobpo-37758: Clean out vestigial script-bits from test_unicodedata. (GH-15126)
Greg Price [Tue, 13 Aug 2019 05:58:01 +0000 (22:58 -0700)]
bpo-37758: Clean out vestigial script-bits from test_unicodedata. (GH-15126)

This file started life as a script, before conversion to a
`unittest` test file.  Clear out some legacies of that conversion
that are a bit confusing about how it works.

Most notably, it's unlikely there's still a good reason to try
to recover from `unicodedata` failing to import -- as there was
when that logic was first added, when the module was very new.
So take that out entirely.  Keep `self.db` working, though, to
avoid a noisy diff.

5 years agobpo-37760: Mark all generated Unicode data headers as generated. (GH-15171)
Greg Price [Tue, 13 Aug 2019 05:23:41 +0000 (22:23 -0700)]
bpo-37760: Mark all generated Unicode data headers as generated. (GH-15171)

This causes them to be collapsed by default in diffs shown on GitHub.

https://bugs.python.org/issue37760

Automerge-Triggered-By: @benjaminp
5 years agobpo-37760: Factor out the basic UCD parsing logic of makeunicodedata. (GH-15130)
Greg Price [Tue, 13 Aug 2019 05:20:56 +0000 (22:20 -0700)]
bpo-37760: Factor out the basic UCD parsing logic of makeunicodedata. (GH-15130)

There were 10 copies of this, and almost as many distinct versions of
exactly how it was written.  They're all implementing the same
standard.  Pull them out to the top, so the more interesting logic
that remains becomes easier to read.

5 years agobpo-37759: Second round of edits to Whatsnew 3.8 (GH-15204)
Raymond Hettinger [Mon, 12 Aug 2019 22:55:18 +0000 (15:55 -0700)]
bpo-37759: Second round of edits to Whatsnew 3.8 (GH-15204)

5 years agoRemove versioned executables from non-APPX packages (GH-15237)
Steve Dower [Mon, 12 Aug 2019 21:56:39 +0000 (14:56 -0700)]
Remove versioned executables from non-APPX packages (GH-15237)

5 years agobpo-37354: Sign Activate.ps1 for release (GH-15235)
Steve Dower [Mon, 12 Aug 2019 21:09:36 +0000 (14:09 -0700)]
bpo-37354: Sign Activate.ps1 for release (GH-15235)

5 years agobpo-37354: Make Powershell Activate.ps1 script static to allow for signing (GH-14967)
Derek Keeler [Mon, 12 Aug 2019 20:06:02 +0000 (13:06 -0700)]
bpo-37354: Make Powershell Activate.ps1 script static to allow for signing (GH-14967)

- Remove use of replacement text in the script
- Make use of the pyvenv.cfg file for prompt value.
- Add parameters to allow more flexibility
- Make use of the current path, and assumptions about where env puts things, to compensate
- Make the script a bit more 'idiomatic' Powershell
- Add script documentation (Get-Help .\.venv\Scripts\Activate.ps1 shows PS help page now

5 years agobpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225)
Dong-hee Na [Mon, 12 Aug 2019 17:41:08 +0000 (02:41 +0900)]
bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225)

5 years agoFix docs for assert_called and assert_called_once (#15197)
Ismail S [Mon, 12 Aug 2019 06:57:03 +0000 (07:57 +0100)]
Fix docs for assert_called and assert_called_once (#15197)

5 years agobpo-37819: Add Fraction.as_integer_ratio() (GH-15212)
Raymond Hettinger [Sun, 11 Aug 2019 21:40:59 +0000 (14:40 -0700)]
bpo-37819: Add Fraction.as_integer_ratio() (GH-15212)

5 years agobpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. (GH-15044)
Abhilash Raj [Sun, 11 Aug 2019 20:45:09 +0000 (13:45 -0700)]
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

5 years agoDelete leftover clinic-generated file for C zipimport. (GH-15174)
Greg Price [Sat, 10 Aug 2019 07:20:27 +0000 (00:20 -0700)]
Delete leftover clinic-generated file for C zipimport. (GH-15174)

5 years agobpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)
Gregory P. Smith [Sat, 10 Aug 2019 07:19:07 +0000 (00:19 -0700)]
bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)

DeprecationWarning will continue to be emitted for invalid escape
sequences in string and bytes literals just as it did in 3.7.

SyntaxWarning may be emitted in the future. But per mailing list
discussion, we don't yet know when because we haven't settled on how to
do so in a non-disruptive manner.

(Applies 4c5b6bac2408f879231c7cd38d67657dd4804e7c to the master branch).
(This is https://github.com/python/cpython/pull/15142 for master/3.9)

https://bugs.python.org/issue32912

Automerge-Triggered-By: @gpshead
5 years agobpo-37642: Update acceptable offsets in timezone (GH-14878)
Ngalim Siregar [Fri, 9 Aug 2019 14:22:16 +0000 (21:22 +0700)]
bpo-37642: Update acceptable offsets in timezone (GH-14878)

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

5 years agobpo-36511: Fix failures in Windows ARM32 buildbot (GH-15181)
Paul Monson [Thu, 8 Aug 2019 23:12:33 +0000 (16:12 -0700)]
bpo-36511: Fix failures in Windows ARM32 buildbot (GH-15181)

5 years agobpo-37795: Capture DeprecationWarnings in the test suite (GH-15184)
Pablo Galindo [Thu, 8 Aug 2019 22:25:46 +0000 (23:25 +0100)]
bpo-37795: Capture DeprecationWarnings in the test suite (GH-15184)

5 years agobpo-37268: test_parser fails when run with -Werror (GH-15183)
Zackery Spytz [Thu, 8 Aug 2019 21:48:00 +0000 (15:48 -0600)]
bpo-37268: test_parser fails when run with -Werror (GH-15183)

Use warnings.filterwarnings() when importing the deprecated parser
module.

@pablogsal

https://bugs.python.org/issue37268

Automerge-Triggered-By: @pablogsal
5 years agobpo-25172: Raise appropriate ImportError msg when crypt module used on Windows (GH...
shireenrao [Thu, 8 Aug 2019 20:02:49 +0000 (16:02 -0400)]
bpo-25172: Raise appropriate ImportError msg when crypt module used on Windows (GH-15149)

5 years agobpo-37587: optimize json.loads (GH-15134)
Inada Naoki [Thu, 8 Aug 2019 08:57:10 +0000 (17:57 +0900)]
bpo-37587: optimize json.loads (GH-15134)

Use a tighter scope temporary variable to help register allocation.
1% speedup for large string.

Use PyDict_SetItemDefault() for memoizing keys.
At most 4% speedup when the cache hit ratio is low.

5 years agobpo-35892: Add usage note to mode() (GH-15122)
Raymond Hettinger [Thu, 8 Aug 2019 08:23:05 +0000 (01:23 -0700)]
bpo-35892: Add usage note to mode() (GH-15122)

5 years agobpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)
Serhiy Storchaka [Thu, 8 Aug 2019 05:43:18 +0000 (08:43 +0300)]
bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)

5 years agobpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)
Serhiy Storchaka [Thu, 8 Aug 2019 05:42:54 +0000 (08:42 +0300)]
bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)

They now return NotImplemented for unsupported type of the other operand.

5 years agobpo-34775: Return NotImplemented in PurePath division. (GH-9509)
aiudirog [Thu, 8 Aug 2019 05:41:10 +0000 (01:41 -0400)]
bpo-34775: Return NotImplemented in PurePath division. (GH-9509)

5 years agobpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
Steve Dower [Wed, 7 Aug 2019 18:39:09 +0000 (11:39 -0700)]
bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)

5 years agobpo-37778: Fixes the icons used for file associations to the Microsoft Store package...
Steve Dower [Wed, 7 Aug 2019 17:50:17 +0000 (10:50 -0700)]
bpo-37778: Fixes the icons used for file associations to the Microsoft Store package (GH-15150)

5 years agobpo-37734: Fix use of registry values to launch Python from Microsoft Store app ...
Steve Dower [Wed, 7 Aug 2019 17:49:40 +0000 (10:49 -0700)]
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)

5 years agoUpdate pickle.rst (GH-14128)
Géry Ogam [Wed, 7 Aug 2019 05:02:23 +0000 (07:02 +0200)]
Update pickle.rst (GH-14128)

* Edits for readability and grammar

5 years agobpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for...
sweeneyde [Wed, 7 Aug 2019 04:37:08 +0000 (00:37 -0400)]
bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for ratio method (GH-13482)

https://bugs.python.org/issue37004

5 years agobpo-37646: Document that eval() cannot access nested scopes (GH-15117)
Raymond Hettinger [Wed, 7 Aug 2019 00:56:22 +0000 (17:56 -0700)]
bpo-37646:  Document that eval() cannot access nested scopes (GH-15117)

5 years agobpo-34488: optimize BytesIO.writelines() (GH-8904)
Sergey Fedoseev [Wed, 7 Aug 2019 00:38:31 +0000 (05:38 +0500)]
bpo-34488: optimize BytesIO.writelines() (GH-8904)

Avoid the creation of unused int object for each line.

5 years agoMake importlib.metadata a simple module (#15153)
Barry Warsaw [Tue, 6 Aug 2019 23:59:07 +0000 (16:59 -0700)]
Make importlib.metadata a simple module (#15153)

5 years agoImprove signal documentation (GH-14274)
Géry Ogam [Tue, 6 Aug 2019 21:12:22 +0000 (23:12 +0200)]
Improve signal documentation (GH-14274)

* add a missing ``.. availability::`` reST explicit markup;
* more consistent "see man page" sentences.

5 years agobpo-37759: First round of major edits to Whatsnew 3.8 (GH-15127)
Raymond Hettinger [Mon, 5 Aug 2019 20:33:19 +0000 (13:33 -0700)]
bpo-37759:  First round of major edits to Whatsnew 3.8 (GH-15127)

5 years agobpo-36419: IDLE - Refactor autocompete and improve testing. (#15121)
Terry Jan Reedy [Sun, 4 Aug 2019 23:48:52 +0000 (19:48 -0400)]
bpo-36419: IDLE - Refactor autocompete and improve testing. (#15121)

5 years agoAdds Tim Hopper and Dan Lidral-Porter to ACKS (GH-15101)
Timothy Hopper [Sun, 4 Aug 2019 21:23:29 +0000 (17:23 -0400)]
Adds Tim Hopper and Dan Lidral-Porter to ACKS (GH-15101)

Tim and Dan were authors for GH-11847

5 years agobpo-37748: Re-order the Run menu. (GH-15115)
Terry Jan Reedy [Sun, 4 Aug 2019 20:45:15 +0000 (16:45 -0400)]
bpo-37748: Re-order the Run menu. (GH-15115)

Put the most common choice, Run Module, at the top.