1 """Deprecated - New code should avoid these"""
4 from ..compat
.compat_utils
import passthrough_module
6 # XXX: Implement this the same way as other DeprecationWarnings without circular import
7 passthrough_module(__name__
, '.._legacy', callback
=lambda attr
: warnings
.warn(
8 DeprecationWarning(f
'{__name__}.{attr} is deprecated'), stacklevel
=6))
12 from ._utils
import preferredencoding
15 def encodeFilename(s
, for_subprocess
=False):
16 assert isinstance(s
, str)
20 def decodeFilename(b
, for_subprocess
=False):
24 def decodeArgument(b
):
28 def decodeOption(optval
):
31 if isinstance(optval
, bytes
):
32 optval
= optval
.decode(preferredencoding())
34 assert isinstance(optval
, str)
38 def error_to_compat_str(err
):