Skip to content

Commit 171c535

Browse files
committed
Deprecate decargs
1 parent 6fbe922 commit 171c535

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

beets/ui/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import sys
2929
import textwrap
3030
import traceback
31+
import warnings
3132
from difflib import SequenceMatcher
3233
from typing import TYPE_CHECKING, Any, Callable
3334

@@ -104,6 +105,21 @@ def _stream_encoding(stream, default="utf-8"):
104105
return stream.encoding or default
105106

106107

108+
def decargs(arglist):
109+
"""Given a list of command-line argument bytestrings, attempts to
110+
decode them to Unicode strings when running under Python 2.
111+
112+
.. deprecated:: 2.4.0
113+
This function will be removed in 3.0.0. Use new_function() instead.
114+
"""
115+
warnings.warn(
116+
"decargs() is deprecated and will be removed in version 3.0.0.",
117+
DeprecationWarning,
118+
stacklevel=2,
119+
)
120+
return arglist
121+
122+
107123
def print_(*strings: str, end: str = "\n") -> None:
108124
"""Like print, but rather than raising an error when a character
109125
is not in the terminal's encoding's character set, just silently

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ For plugin developers:
8686
* ``beets.autotag.current_metadata`` has been renamed to
8787
``beets.util.get_most_common_tags``.
8888

89+
Old imports are now deprecated and will be removed in version ``3.0.0``.
90+
* ``beets.ui.decargs`` is deprecated and will be removed in version ``3.0.0``.
91+
92+
8993
Other changes:
9094

9195
* Refactor: Split responsibilities of Plugins into MetaDataPlugins and general Plugins.

0 commit comments

Comments
 (0)