bundles / IPython latest / IPython / utils / openpy / source_to_unicode
function
IPython.utils.openpy:source_to_unicode
source: /IPython/utils/openpy.py :19
Signature
def source_to_unicode ( txt : str | bytes | BytesIO , errors : str = replace , skip_encoding_cookie : bool = True ) → str Summary
Converts a bytes string with python source code to unicode.
Extended Summary
Unicode strings are passed through unchanged. Byte strings are checked for the python source file encoding cookie to determine encoding. txt can be either a bytes buffer or a string containing the source code.
Aliases
-
IPython.utils.openpy.source_to_unicode