Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions Doc/deprecations/pending-removal-in-3.19.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ Pending removal in Python 3.19
supported depending on the backend implementation of hash functions.
Prefer passing the initial data as a positional argument for maximum
backwards compatibility.

* :mod:`http.cookies`:

* :meth:`http.cookies.Morsel.js_output` is deprecated and will be
removed in Python 3.19.

* :meth:`http.cookies.BaseCookie.js_output` is deprecated and will be
removed in Python 3.19.

12 changes: 12 additions & 0 deletions Doc/library/http.cookies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ Cookie Objects

The meaning for *attrs* is the same as in :meth:`output`.

.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach.
Use :meth:`~http.cookies.BaseCookie.output` instead to generate HTTP
headers.


.. method:: BaseCookie.load(rawdata)

Expand Down Expand Up @@ -223,6 +229,12 @@ Morsel Objects

The meaning for *attrs* is the same as in :meth:`output`.

.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach.
Use :meth:`~http.cookies.Morsel.output` instead to generate HTTP
headers.


.. method:: Morsel.OutputString(attrs=None)

Expand Down
10 changes: 10 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,16 @@ New deprecations
(Contributed by Bénédikt Tran in :gh:`134978`.)


* :mod:`http.cookies`:

* :meth:`Morsel.js_output <http.cookies.Morsel.js_output>` and
:meth:`BaseCookie.js_output <http.cookies.BaseCookie.js_output>` are
deprecated and will be removed in Python 3.19. Use
:meth:`Morsel.output <http.cookies.Morsel.output>` or
:meth:`BaseCookie.output <http.cookies.BaseCookie.output>` instead.
(Contributed by kishorhange111 in :gh:`148849`.)


* :mod:`re`:

* :func:`re.match` and :meth:`re.Pattern.match` are now
Expand Down
4 changes: 4 additions & 0 deletions Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ extern int _PyDict_Next(

extern int _PyDict_HasOnlyStringKeys(PyObject *mp);

PyAPI_FUNC(PyObject *) _PyDict_Subscript(PyObject *self, PyObject *key);
PyAPI_FUNC(PyObject *) _PyDict_SubscriptKnownHash(PyObject *self, PyObject *key, Py_hash_t hash);
PyAPI_FUNC(int) _PyDict_StoreSubscript(PyObject *self, PyObject *key, PyObject *value);

// Export for '_ctypes' shared extension
PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *);

Expand Down
8 changes: 4 additions & 4 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 32 additions & 32 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions Lib/http/cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
import re
import string
import types
lazy import warnings

__all__ = ["CookieError", "BaseCookie", "SimpleCookie"]

Expand Down Expand Up @@ -390,7 +391,9 @@ def output(self, attrs=None, header="Set-Cookie:"):
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self.OutputString())

def js_output(self, attrs=None):

def _js_output(self, attrs=None):
"""Internal implementation without deprecation warning."""
import base64
# Print javascript
output_string = self.OutputString(attrs)
Expand All @@ -407,6 +410,14 @@ def js_output(self, attrs=None):
</script>
""" % (output_encoded,)

def js_output(self, attrs=None):
warnings._deprecated(
"http.cookies.Morsel.js_output",
message=warnings._DEPRECATED_MSG + "; use output() instead",
remove=(3, 19),
)
return self._js_output(attrs)

def OutputString(self, attrs=None):
# Build up our result
#
Expand Down Expand Up @@ -541,10 +552,15 @@ def __repr__(self):

def js_output(self, attrs=None):
"""Return a string suitable for JavaScript."""
warnings._deprecated(
"http.cookies.BaseCookie.js_output",
message=warnings._DEPRECATED_MSG + "; use output() instead",
remove=(3, 19),
)
result = []
items = sorted(self.items())
for key, value in items:
result.append(value.js_output(attrs))
result.append(value._js_output(attrs))
return _nulljoin(result)

def load(self, rawdata):
Expand Down
14 changes: 7 additions & 7 deletions Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3713,18 +3713,18 @@ def help():
pydoc.pager(__doc__)

_usage = """\
Debug the Python program given by pyfile. Alternatively,
Debug the Python program given by `pyfile`. Alternatively,
an executable module or package to debug can be specified using
the -m switch. You can also attach to a running Python process
using the -p option with its PID.
the `-m` switch. You can also attach to a running Python process
using the `-p` option with its PID.

Initial commands are read from .pdbrc files in your home directory
Initial commands are read from `.pdbrc` files in your home directory
and in the current directory, if they exist. Commands supplied with
-c are executed after commands from .pdbrc files.
`-c` are executed after commands from `.pdbrc` files.

To let the script run until an exception occurs, use "-c continue".
To let the script run until an exception occurs, use `-c continue`.
To let the script run up to a given line X in the debugged file, use
"-c 'until X'"."""
`-c 'until X'`."""


def exit_with_permission_help_text():
Expand Down
Loading
Loading