Visitar URL original
bpo-40334: Produce better error messages on invalid targets by lysnikolaou · Pull Request #20106 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0dfaa22
bpo-40334: Produce better error messages on invalid targets
lysnikolaou May 15, 2020
d4a9dd6
Fix test_exceptions
lysnikolaou May 15, 2020
72a1339
📜🤖 Added by blurb_it.
blurb-it[bot] May 15, 2020
1b6cf0b
Produce the same error messages with the old parser for with and for …
lysnikolaou May 15, 2020
1ad3819
Add invalid_group rule
lysnikolaou May 15, 2020
6f30315
Update Grammar/python.gram
lysnikolaou May 16, 2020
f750aba
Update Parser/pegen/pegen.c
lysnikolaou May 16, 2020
132178f
Address Guido's feedback
lysnikolaou May 16, 2020
17cc4bc
Inline _PyPegen_get_invalid_for_target
lysnikolaou May 17, 2020
def0f3d
Revert inlining
lysnikolaou May 17, 2020
ee3524b
Merge remote-tracking branch 'upstream/master' into targets-errors
pablogsal May 17, 2020
4959a12
Fix searching for invalid for targets, by visiting Compare nodes in _…
lysnikolaou May 17, 2020
dd1d8c8
Call RAISE_SYNTAX_ERROR instead of returning NULL, when no invalid fo…
lysnikolaou May 17, 2020
24d63fb
Merge branch 'master' into targets-errors
lysnikolaou May 18, 2020
c1cf8e6
Replace is_del and is_for args with an enum
lysnikolaou May 18, 2020
06798ff
Only return an invalid target, when the comparison is an In comparison
lysnikolaou May 20, 2020
ef7fe3a
Fix bug
lysnikolaou May 20, 2020
efabcc9
Merge branch 'master' into targets-errors
lysnikolaou May 23, 2020
6d41c55
Merge branch 'master' into targets-errors
lysnikolaou May 26, 2020
82486c1
Minor refactoring
lysnikolaou May 26, 2020
705d55b
Merge branch 'master' into targets-errors
lysnikolaou Jun 10, 2020
f0f934d
Merge branch 'master' into targets-errors
lysnikolaou Jun 10, 2020
ede107e
Merge branch 'master' into targets-errors
lysnikolaou Jun 18, 2020
55b5327
Add CHECK* checks to GET_INVALID_*TARGET macros
lysnikolaou Jun 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into targets-errors
  • Loading branch information
lysnikolaou committed Jun 18, 2020
commit ede107e1faa4a75fae477af10074931c061cff11
4 changes: 2 additions & 2 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
Expand Down
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ matrix:
packages:
- xvfb
before_script:
- |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
then
echo "Don't run Python coverage on pull requests."
exit
fi
- ./configure
- make -j4
# Need a venv that can parse covered code.
Expand Down Expand Up @@ -109,6 +115,12 @@ matrix:
- lcov
- xvfb
before_script:
- |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
then
echo "Don't run C coverage on pull requests."
exit
fi
- ./configure
script:
- xvfb-run make -j4 coverage-report
Expand Down
10 changes: 3 additions & 7 deletions Doc/c-api/conversion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ not.

The wrappers ensure that *str*[*size*-1] is always ``'\0'`` upon return. They
never write more than *size* bytes (including the trailing ``'\0'``) into str.
Both functions require that ``str != NULL``, ``size > 0`` and ``format !=
NULL``.

If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed to
avoid truncation exceeds *size* by more than 512 bytes, Python aborts with a
:c:func:`Py_FatalError`.
Both functions require that ``str != NULL``, ``size > 0``, ``format != NULL``
and ``size < INT_MAX``.

The return value (*rv*) for these functions should be interpreted as follows:

Expand All @@ -48,8 +44,8 @@ The return value (*rv*) for these functions should be interpreted as follows:
this case too, but the rest of *str* is undefined. The exact cause of the error
depends on the underlying platform.

The following functions provide locale-independent string to number conversions.

The following functions provide locale-independent string to number conversions.

.. c:function:: double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception)

Expand Down
10 changes: 0 additions & 10 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -695,16 +695,6 @@ PyConfig

:data:`sys._xoptions`.

.. c:member:: int _use_peg_parser

Enable PEG parser? Default: 1.

Set to 0 by :option:`-X oldparser <-X>` and :envvar:`PYTHONOLDPARSER`.

See also :pep:`617`.

.. deprecated-removed:: 3.9 3.10

If ``parse_argv`` is non-zero, ``argv`` arguments are parsed the same
way the regular Python parses command line arguments, and Python
arguments are stripped from ``argv``: see :ref:`Command Line Arguments
Expand Down
4 changes: 2 additions & 2 deletions Doc/howto/logging-cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ An example dictionary-based configuration
-----------------------------------------

Below is an example of a logging configuration dictionary - it's taken from
the `documentation on the Django project <https://docs.djangoproject.com/en/1.9/topics/logging/#configuring-logging>`_.
the `documentation on the Django project <https://docs.djangoproject.com/en/stable/topics/logging/#configuring-logging>`_.
This dictionary is passed to :func:`~config.dictConfig` to put the configuration into effect::

LOGGING = {
Expand Down Expand Up @@ -1424,7 +1424,7 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
}

For more information about this configuration, you can see the `relevant
section <https://docs.djangoproject.com/en/1.9/topics/logging/#configuring-logging>`_
section <https://docs.djangoproject.com/en/stable/topics/logging/#configuring-logging>`_
of the Django documentation.

.. _cookbook-rotator-namer:
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/imp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
**Source code:** :source:`Lib/imp.py`

.. deprecated:: 3.4
The :mod:`imp` package is pending deprecation in favor of :mod:`importlib`.
The :mod:`imp` module is deprecated in favor of :mod:`importlib`.

.. index:: statement: import

Expand Down
12 changes: 12 additions & 0 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4622,6 +4622,12 @@ support membership tests:
.. versionchanged:: 3.8
Dictionary views are now reversible.

.. describe:: dictview.mapping

Return a :class:`types.MappingProxyType` that wraps the original
dictionary to which the view refers.

.. versionadded:: 3.10

Keys views are set-like since their entries are unique and hashable. If all
values are hashable, so that ``(key, value)`` pairs are unique and hashable,
Expand Down Expand Up @@ -4661,6 +4667,12 @@ An example of dictionary view usage::
>>> keys ^ {'sausage', 'juice'}
{'juice', 'sausage', 'bacon', 'spam'}

>>> # get back a read-only proxy for the original dictionary
>>> values.mapping
mappingproxy({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})
>>> values.mapping['spam']
500


.. _typecontextmanager:

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.