# Path: ddsc/exceptions.py
# class DDSUserException(Exception):
#     """
#     Exception with an error message to be displayed to the user on the command line.
#     """
#     pass


import sys
import os
import platform
import stat
import time
from ddsc.exceptions import DDSUserException
        elif progress_type == ProgressQueue.DONE_WAITING:
            watcher.done_waiting()
        else:
            error_message = value
            for process in processes:
                process.terminate()
            raise DDSUserException(error_message)
    for process in processes:
        process.join()


def verify_terminal_encoding(encoding):
    """
    Raises ValueError with error message when terminal encoding is not Unicode(contains UTF ignoring case).
    :param encoding: str: encoding we want to check
    """
    if encoding and not ("UTF" in encoding.upper()):
        raise DDSUserException(TERMINAL_ENCODING_NOT_UTF_ERROR)


def verify_file_private(filename):
    """
    Raises ValueError the file permissions allow group/other
    On windows this never raises due to the implementation of stat.
    """
    if platform.system().upper() != 'WINDOWS':
        filename = os.path.expanduser(filename)
        if os.path.exists(filename):
            file_stat = os.stat(filename)
            if mode_allows_group_or_other(file_stat.st_mode):

# Path: ddsc/exceptions.py
# class DDSUserException(Exception):
#     """
#     Exception with an error message to be displayed to the user on the command line.
#     """
#     pass


# Path: ddsc/core/util.py
import sys
import os
import platform
import stat
import time
from ddsc.exceptions import DDSUserException

        elif progress_type == ProgressQueue.DONE_WAITING:
            watcher.done_waiting()
        else:
            error_message = value
            for process in processes:
                process.terminate()
            raise DDSUserException(error_message)
    for process in processes:
        process.join()


def verify_terminal_encoding(encoding):
    """
    Raises ValueError with error message when terminal encoding is not Unicode(contains UTF ignoring case).
    :param encoding: str: encoding we want to check
    """
    if encoding and not ("UTF" in encoding.upper()):
        raise DDSUserException(TERMINAL_ENCODING_NOT_UTF_ERROR)


def verify_file_private(filename):
    """
    Raises ValueError the file permissions allow group/other
    On windows this never raises due to the implementation of stat.
    """
    if platform.system().upper() != 'WINDOWS':
        filename = os.path.expanduser(filename)
        if os.path.exists(filename):
            file_stat = os.stat(filename)
            if mode_allows_group_or_other(file_stat.st_mode):

                raise DDSUserException(CONFIG_FILE_PERMISSIONS_ERROR)