Source code for eyed3

# -*- coding: utf-8 -*-
import sys
import locale
from .__about__ import __version__ as version                            # noqa


_DEFAULT_ENCODING = "latin1"

LOCAL_ENCODING = locale.getpreferredencoding(do_setlocale=True)
'''The local encoding, used when parsing command line options, console output,
etc. The default is always ``latin1`` if it cannot be determined, it is NOT
the value shown.'''
if not LOCAL_ENCODING or LOCAL_ENCODING == "ANSI_X3.4-1968":  # pragma: no cover
    LOCAL_ENCODING = _DEFAULT_ENCODING

LOCAL_FS_ENCODING = sys.getfilesystemencoding()
'''The local file system encoding, the default is ``latin1`` if it cannot be
determined.'''
if not LOCAL_FS_ENCODING:  # pragma: no cover
    LOCAL_FS_ENCODING = _DEFAULT_ENCODING


[docs]class Error(Exception): '''Base exception type for all eyed3 errors.''' def __init__(self, *args): super(Error, self).__init__(*args) if args: # The base class will do exactly this if len(args) == 1, # but not when > 1. Note, the 2.7 base class will, 3 will not. # Make it so. self.message = args[0]
from .utils.log import log # noqa from .core import load # noqa del sys del locale