]> granicus.if.org Git - python/log
python
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.

5 years agoUpdate itertools docs (GH-15114)
Raymond Hettinger [Sun, 4 Aug 2019 20:35:58 +0000 (13:35 -0700)]
Update itertools docs (GH-15114)

* Remove suggestion that is less relevant now that global lookups are much faster
* Add link for installing the recipes

5 years agobpo-28292: Mark calendar.py helper functions as private. (GH-15113)
Raymond Hettinger [Sun, 4 Aug 2019 20:14:03 +0000 (13:14 -0700)]
bpo-28292: Mark calendar.py helper functions as private. (GH-15113)

5 years agobpo-36324: Update comments to include the target hash sums (GH-15110)
Raymond Hettinger [Sun, 4 Aug 2019 18:52:04 +0000 (11:52 -0700)]
bpo-36324: Update comments to include the target hash sums (GH-15110)

5 years agobpo-37706: IDLE - fix sidebar code bug and drag tests (GH-15103)
Tal Einat [Sun, 4 Aug 2019 16:25:27 +0000 (19:25 +0300)]
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.

5 years agobpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)
Serhiy Storchaka [Sun, 4 Aug 2019 11:12:48 +0000 (14:12 +0300)]
bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)

The collection's item is now always at the left and
the needle is on the right of ==.

5 years agobpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)
Serhiy Storchaka [Sun, 4 Aug 2019 09:38:46 +0000 (12:38 +0300)]
bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)

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.

5 years agoCorrect description of HTTP status code 308. (GH-15078)
Florian Wendelborn [Sat, 3 Aug 2019 18:16:34 +0000 (20:16 +0200)]
Correct description of HTTP status code 308. (GH-15078)

Permanent redirect was explained as a temporary redirect.

5 years agobpo-18049: Define THREAD_STACK_SIZE for AIX to pass default recursion limit test...
Michael Felt [Sat, 3 Aug 2019 06:12:26 +0000 (08:12 +0200)]
bpo-18049: Define THREAD_STACK_SIZE for AIX to pass default recursion limit test (GH-15081)

* Define THREAD_STACK_SIZE for AIX to pass default recursion limit test

5 years agobpo-37444: Update differing exception between builtins and importlib (GH-14869)
Ngalim Siregar [Sat, 3 Aug 2019 05:46:02 +0000 (12:46 +0700)]
bpo-37444: Update differing exception between builtins and importlib (GH-14869)

Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure.

https://bugs.python.org/issue37444

Automerge-Triggered-By: @brettcannon
5 years agobpo-30974: Change os.path.samefile docstring to match docs (GH-7337)
Timo Furrer [Fri, 2 Aug 2019 22:44:25 +0000 (00:44 +0200)]
bpo-30974: Change os.path.samefile docstring to match docs (GH-7337)

5 years agobpo-20523: pdb searches for .pdbrc in ~ instead of $HOME (GH-11847)
Timothy Hopper [Fri, 2 Aug 2019 22:20:14 +0000 (18:20 -0400)]
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>
5 years agobpo-36590: Add Bluetooth RFCOMM and support for Windows. (GH-12767)
Greg Bowser [Fri, 2 Aug 2019 20:29:52 +0000 (16:29 -0400)]
bpo-36590: Add Bluetooth RFCOMM and support for Windows. (GH-12767)

Support for RFCOMM, L2CAP, HCI, SCO is based on the BTPROTO_* macros
being defined. Winsock only supports RFCOMM, even though it has a
BTHPROTO_L2CAP macro. L2CAP support would build on windows, but not
necessarily work.

This also adds some basic unittests for constants (all of which existed
prior to this commit, just not on windows) and creating sockets.

pair: Nate Duarte <slacknate@gmail.com>

5 years agobpo-37742: Return the root logger when logging.getLogger('root') is c… (#15077)
Vinay Sajip [Fri, 2 Aug 2019 15:53:00 +0000 (16:53 +0100)]
bpo-37742: Return the root logger when logging.getLogger('root') is c… (#15077)

* bpo-37742: Return the root logger when logging.getLogger('root') is called.

* Added type check guard on logger name in logging.getLogger() and refined a test.

5 years agobpo-36487: Make C-API docs clear about what the main interpreter is. (gh-12666)
Joannah Nanjekye [Fri, 2 Aug 2019 15:50:22 +0000 (12:50 -0300)]
bpo-36487: Make C-API docs  clear about what the main interpreter is. (gh-12666)

5 years agobpo-37729: gc: write stats at once (GH-15050)
Inada Naoki [Fri, 2 Aug 2019 07:25:29 +0000 (16:25 +0900)]
bpo-37729: gc: write stats at once (GH-15050)

gc used several PySys_WriteStderr() calls to write stats.
It caused stats mixed up when stderr is shared by multiple
processes like this:

  gc: collecting generation 2...
  gc: objects in each generation: 0 0gc: collecting generation 2...
  gc: objects in each generation: 0 0 126077 126077
  gc: objects in permanent generation: 0

  gc: objects in permanent generation: 0
  gc: done, 112575 unreachable, 0 uncollectablegc: done, 112575 unreachable, 0 uncollectable, 0.2223s elapsed
  , 0.2344s elapsed

5 years agobpo-16970: Adding error message for invalid args (GH-14844)
tmblweed [Fri, 2 Aug 2019 04:57:13 +0000 (21:57 -0700)]
bpo-16970: Adding error message for invalid args (GH-14844)

BPO -16970: Adding error message for invalid args

Applied the patch argparse-v2 patch issue 16970, ran patch check and the test suite, test_argparse with 0 errors

https://bugs.python.org/issue16970

5 years agobpo-37726: Prefer argparse over getopt in stdlib tutorial (#15052)
mental [Thu, 1 Aug 2019 14:17:30 +0000 (15:17 +0100)]
bpo-37726: Prefer argparse over getopt in stdlib tutorial (#15052)

5 years agobpo-36302: Sort list of sources (GH-12341)
Bernhard M. Wiedemann [Thu, 1 Aug 2019 13:18:03 +0000 (15:18 +0200)]
bpo-36302: Sort list of sources (GH-12341)

When building packages (e.g. for openSUSE Linux)
(random) filesystem order of input files
influences ordering of functions in the output .so files.
Thus without the patch, builds (in disposable VMs) would usually differ.

Without this patch, all callers have to be patched individually
https://github.com/dugsong/libdnet/pull/42
https://github.com/sass/libsass-python/pull/212
https://github.com/tahoe-lafs/pycryptopp/pull/41
https://github.com/yt-project/yt/pull/2206
https://github.com/pyproj4/pyproj/pull/142
https://github.com/pytries/datrie/pull/49
https://github.com/Roche/pyreadstat/pull/37
but that is an infinite effort.

See https://reproducible-builds.org/ for why this matters.

5 years agobpo-18049: Sync thread stack size to main thread size on macOS (GH-14748)
Ronald Oussoren [Thu, 1 Aug 2019 05:43:07 +0000 (07:43 +0200)]
bpo-18049: Sync thread stack size to main thread size on macOS (GH-14748)

This changeset increases the default size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.

5 years agobpo-37730: Fix usage of NotImplemented instead of NotImplementedError in docs. (GH...
David H [Wed, 31 Jul 2019 22:49:55 +0000 (23:49 +0100)]
bpo-37730: Fix usage of NotImplemented instead of NotImplementedError in docs. (GH-15062)

5 years agobpo-37723: Fix performance regression on regular expression parsing. (GH-15030)
yannvgn [Wed, 31 Jul 2019 18:50:39 +0000 (20:50 +0200)]
bpo-37723: Fix performance regression on regular expression parsing. (GH-15030)

Improve performance of sre_parse._uniq function.

5 years agobpo-34101: Add doc of PyBuffer_GetPointer (GH-14994)
Hai Shi [Wed, 31 Jul 2019 14:48:15 +0000 (09:48 -0500)]
bpo-34101: Add doc of PyBuffer_GetPointer (GH-14994)

5 years agobpo-37695: Correct unget_wch error message. (GH-14986)
Anthony Sottile [Wed, 31 Jul 2019 12:11:24 +0000 (05:11 -0700)]
bpo-37695: Correct unget_wch error message. (GH-14986)

5 years agobpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)
karl ding [Wed, 31 Jul 2019 08:47:16 +0000 (01:47 -0700)]
bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)

Expose the CAN_BCM SocketCAN constants used in the bcm_msg_head struct
flags (provided by <linux/can/bcm.h>) under the socket library.

This adds the following constants with a CAN_BCM prefix:

  * SETTIMER
  * STARTTIMER
  * TX_COUNTEVT
  * TX_ANNOUNCE
  * TX_CP_CAN_ID
  * RX_FILTER_ID
  * RX_CHECK_DLC
  * RX_NO_AUTOTIMER
  * RX_ANNOUNCE_RESUME
  * TX_RESET_MULTI_IDX
  * RX_RTR_FRAME
  * CAN_FD_FRAME

The CAN_FD_FRAME flag was introduced in the 4.8 kernel, while the other
ones were present since SocketCAN drivers were mainlined in 2.6.25. As
such, it is probably unnecessary to guard against these constants being
missing.